2011. 7. 1. 14:01 아이폰

 정리 다 필요없고 

http://www.cocoadev.co.kr/33

이블로그 찾아 보면 끝난다 
objective c 설명이 잘되어있다

 


#define _TESTDEF

#ifdef _TESTDEF

#define TESTDEFLOGIC(a) (a+10)

#else

#define TESTDEFLOGIC(a) (a+15)

#endif



int testintarray[]={0,1,2,3,4,5};

int a[10] = { 0, 2, 4, 6, 8 }; //0~4까지 입력되고 나며지는 0으로 세팅된다 

int *testpointarray;


typedef struct _st{

int a;

}st;

struct employee {

int id;

};

enum testenum {

ENUM_0,

ENUM_1

};   


id *struc;

struc = malloc(sizeof(st));

((st *)struc)->a = 100;

NSLog(@"%d",((st *)struc)->a);

free(struc);

st *struc2;

struc2 = malloc(sizeof(st));

struc2->a = 100;

NSLog(@"%d",struc2->a);

free(struc2);

testpointarray = malloc(sizeof(int) * 10);

testpointarray[0]=1;

NSLog(@"%d",testpointarray[0]);

free(testpointarray);

struct employee emp1[2];

emp1[0].id = 99;

NSLog(@"%d",emp1[0].id);

NSLog(@"%d",ENUM_0);

NSLog(@"%d",ENUM_1);

NSLog(@"TESTDEFLOGIC %d",TESTDEFLOGIC(10)); 

posted by 욱이다