c++学习 -- #program once

#program once ,

在VS2015新建控制台工程时经常在工程源文件中遇到,细细想来一般此语句是为了避免同一个文件被include多次,举例:

  #ifndef VECTOR_H_
  #define VECTOR_H_

  ..................................

  #endif

功能相似!

#pragma once一般由编译器提供保证:同一个文件不会被包含多次

原文地址:https://www.cnblogs.com/huhuhusanling/p/10864069.html