Tuesday, December 17, 2013

objective-c * number of basic questions about

Time and sometimes not quite understand the definition need to add an asterisk before the name, sometimes without wondering with and without distinction, and what does it mean, I hope you can explain, I novice, so I hope to try to say Popular point. I hope not limited to, address, and the difference between the value of the answer.
Here is an example I do not understand.
FILE * file = fopen ("/ tmp / words.txt", "r");
char word [100];
Where, why, when the definition file need to add an asterisk, and like other int char type variables, such as when they do not need to add that way.
Reply:
Plus * indicates a pointer, not int char can not add, if you want to define a pointer variable of
also need to add *
Reply:
Something to be used on the frame * indicates a pointer
Reply:
int char is a pointer variable basic types do not need to manage
FILE NSString belong to other types of object reference types is needed to modify and call
*
If the landlord is to learn java or c # so the transition can actually compare
In fact, java, string or file a statement when String str or File file
Also declares a reference, but do not * to distinguish it
Reply:
fopen ()

The return value of the function is FILE *,,,

No comments:

Post a Comment