GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Monday, December 20, 2010

C define and typedef

The two keyword used to make subtitution for a word:

#define ptr int*
and
typedef int* ptr;

is same.

#define is used for make a constant. The cosntant is whatever. no ";" included.
typedef is used for make a macro of the same type.

#define name "Lady Gaga"
#define id 12345
#define number int

typedef int number;
typedef number lol;
typedef "po" lola;                // not valid
     
Share/Bookmark

No comments:

Post a Comment