C - typeDef, volatile, #prama

원종서·2023년 2월 16일
0

typedef

Example


struct HUMAN {
	int age;
    char[50] name;
};

typedef struct SENSOR {
	int data;
}Sensor;

int add(int a, int b) {return a+b;}

typedef struct HUMAN Human;
typedef int CAL_type;
typedef int (*Padd)(int,int);
typedef int Arrays[50];


int main(){
	Human* human = (Human*)malloc(sizeof(Human));
    Sensor sensor ;
    
    CAL_Type a = 10;
    Arrays arr = {1,2,3,4,5,6,7,8,9,0};
    
    Padd ptr = add;
    
    int c = ptr(3,5); // c == 8
}

0개의 댓글