我认为这*something和* something是不同的.
额外的空白区域有什么作用?
发生在这里 - > void * malloc( size_t number_bytes );
Jus*_*ini 12
int* foo == int *foo == int * foo == int * foo
Run Code Online (Sandbox Code Playgroud)
空格对编译器没有任何影响.
Mar*_*ers 10
当您使用星号来获取地址的值时,它被称为解除引用运算符.例如:
int x = *something;
Run Code Online (Sandbox Code Playgroud)
在您的问题的示例中,星号具有不同的含义,因为它是类型的一部分,而不是表达式的一部分.它用于指定返回类型是指针(在您的特定示例中,为void指针).
额外的空间没有任何意义,编译器会忽略它.它只是为了提高可读性.