Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 오늘 우리가 배울 것은 __P 이다.
- *
- * __P에서 P는 Proto 를 뜻하는 것이다. 아래 코드를 보자.
- *
- */
- # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
- # define __P(protos) protos
- # else
- # define __P(protos) ()
- # endif
- /*
- * 위의 코드는 __P가 어떻게 정의되어있는지를 잘 보여준다.
- *
- * 보면, __STDC__, __GNUC__, __cplusplus, PROTOTYPES 가 정의되어있으면
- * __P(proto) 는 그냥 proto가 되는 것이고.
- * 위의 정의되어있지 않다면, 아무것도 아닌거다.
- */
- int test __P((int));
- int main(int argc, char** argv)
- {
- printf("%d\n", test(1));
- return 0;
- }
- int test(int a)
- {
- return a;
- }
- /*
- * 위와 같이 프로토 타입을 나열할 때 쓰인다.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement