2008년 3월 5일 수요일

xlc 컴파일러의 __VA_ARGS__ 사용 예



#define LOG_PRINT(level, ...) my_logprint(int level, __VA_ARGS__)

void my_logprint(int level, char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);
...
va_end(ap);
}


위 코드에서 주의할 점은 매크로 정의 라인에서는 첫번째 파라메터 이후에 __VA_ARGS__ 가
오고 함수 정의에서는 두번째 파라메터 이후에 ... 이 온다는 것이다.

2008년 3월 3일 월요일

객체지향 용어 정리

1. Class - A class is a model of an entity or object.
2. Instance - An instance is a nonspecific actualization of the class.
3. Object - An object is a specific actualization of the class model, created at runtime, which uses the class as a template.
4. Message - A message is a specific behavior undertaken by the object, requesting the receiver to perform a behavior.
5. Method - Methods are the associated actions performed by an object when it receives the message.