-
헤더파일의 중복방지방법카테고리 없음 2013. 2. 20. 01:51반응형Point.h#ifndef POINT_HPoint.h -->헤더 파일 임#define POINT_Hstruct Point{int x,y;};#endif//Example.cpp#include "Piont.h"#include "Piont.h"int main(){Point pt ={3,4};return 0;}규칙 1. 헤더파일의 이름을 따서 심볼을 만든다 (POINT_H)--> point.h 의 헤더파일의 이름을 따서 만듬규칙 2. 헤더파일의 제일앞에 이심볼을 사용해서 #define 명령을 추가규칙 3. 헤더 파일의 제일 끝에 #endif 를 추가반응형