I am working on an exercise in Objective-C to have a complete list of primitive types and to learn how large each primitive type is in Objective-C. I have the following code written. This code shows me the size of each primitive.
Am I missing any Objective-C primitives?
Am I missing any Objective-C primitives?
Code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
// calculate the sizes of C-Primitives
int i = 1;
NSLog(@"Primitive sizes:");
NSLog(@"%d The size of a char is: %d.", i++, sizeof(char));
NSLog(@"%d The size of short is: %d.", i++, sizeof(short));
NSLog(@"%d The size of int is: %d.", i++, sizeof(int));
NSLog(@"%d The size of long is: %d.", i++, sizeof(long));
NSLog(@"%d The size of long long is: %d.", i++, sizeof(long long));
NSLog(@"%d The size of a unsigned char is: %d.", i++, sizeof(unsigned char));
NSLog(@"%d The size of unsigned short is: %d.", i++, sizeof(unsigned short));
NSLog(@"%d The size of unsigned int is: %d.", i++, sizeof(unsigned int));
NSLog(@"%d The size of unsigned long is: %d.", i++, sizeof(unsigned long));
NSLog(@"%d The size of unsigned long long is: %d.", i++, sizeof(unsigned long long));
NSLog(@"%d The size of a float is: %d.", i++, sizeof(float));
NSLog(@"%d The size of a double is %d.", i++, sizeof(double));
return 0;
}