I just came across this line of code where a method is being instantiated without the use of either + or -. Can you please explain the code :
void *ABCD(NSString *xyz)
I just came across this line of code where a method is being instantiated without the use of either + or -. Can you please explain the code :
void *ABCD(NSString *xyz)
That is a C function, of the type
return_type method_name (argument_list)
Your function returns a void *
, a generic pointer, and takes an NSString
arguement.
With a semicolon at the end, it's a C function declaration. If you follow the spiral rule for C declarations:
What is ABCD
? ABCD
is a function that takes a pointer to an NSString
and returns a pointer to void
. (ie. a pointer to elements of any data type).
Knowing the spiral rule is useful because C function declarations can be very complex.