[C/C++]The differences between #ifndef & #pragma once

#ifndef CLASSNAME_H
#define CLASSNAME_H

#endif

This method can not solve the problem that once two classname is the same,then both of the class with same names could not be compiled.

#pragma once

This could not deal with the situation that if there are two or more .h file which are the same.

猜你喜欢

转载自blog.csdn.net/chenhanxuan1999/article/details/83152005
今日推荐