MSDN里有这样一段文字,关于“#pragma once”用法,它是说编译时只包含一次,它是不是等价于
#ifndef _HEAD_H_
#define _HEAD_H_//...#endif

解决方案 »

  1.   

    Specifies that the file, in which the pragma resides, will be included (opened) only once by the compiler in a build.
      

  2.   

    About #pragmaEach implementation of C and C++ supports some features unique to its host machine or operating system. Some programs, for instance, need to exercise precise control over the memory areas where data is placed or to control the way certain functions receive parameters. The #pragma directives offer a way for each compiler to offer machine- and operating-system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine- or operating-system-specific by definition, and are usually different for every compiler.