Convention for the Index *

Out of curiosity; why the convention for C pointers is as follows:

NSString *str = ...

It would not be more convenient to write:

NSString* str = ...

because we are defining a pointer to an NSString? (in Objective-C we have (NSString *) parameter1)

Again - I ask out of curiosity and to be able to better understand the logic behind this ... I am not trying to reinvent the wheel or start a fiery war.

+5
source share
1 answer

If you declare multiple pointer variables in one declaration, you should write

char *a, *b;

since the announcement

char* a, b;

a char, b char. IOW, , , .

+21

All Articles