SA, I know that Objective-C is a strict superset of C ..
But when I tried a very simple enumeration example that I used to use in C, it did not work in the C object,
Here is the code:
#import <Foundation/Foundation.h> int main(void) { typedef enum { SUN, MON, TUES }DAYS; DAYS d = MON; NSLog(@"%@", d); return 0; }
#include <stdio.h> int main(void) { typedef enum { SUN, MON, TUES }DAYS; DAYS d = MON; printf("%d\n", d); return 0; }
In C it works fine, but in Objective-C (I use GNUstep in WIN) it crashes at runtime (without compile-time errors)
Can someone tell me why?
source share