I am reading a book called "Programming in Objective-C", Sixth Edition, by Stephen G. Kochan. It has the following statement on page 144 which is confusing me:
Local variables that are basic C data types have no default initial value, so you must set them to some value before using them.
Yet when I have the following code, it still works, and displays 0:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
int number;
NSLog(@"%i", number);
return 0;
}
Isn't int
a basic C data type?