#ifndefine NAME_H_

#ifndefine   NAME_H_ 
#define   NAME_H_   
class   Stact 

    public: 
      Stcat(); 
      ~Stcat(); 
    //.............. 
    protced: 
        char*   str; 
        int   a; 


#endif 

防止重複include的情況: 
比如: 
a.h: 
#include   "name.h " 
..... 


b.h: 
#include   "name.h " 
#include   "a.h " 
...... 

如果沒有#ifndef   NAME_H_ 
#define   NAME_H_ 
#endif 
這種機制,則會造成編譯時出錯(class   Stact重複定義)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章