亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

The c++ declaration is placed in the a.h file, and the implementation is placed in a.cpp. Why can the class implemented in a.cpp be used by referencing a.h in main.cpp?
為情所困
為情所困 2017-05-31 10:39:52
0
2
1005

Use visual studio to write a c program. The c declaration is placed in the a.h file, and the implementation is placed in a.cpp. Why can you use the class implemented in a.cpp by referencing a.h in main.cpp, while referencing a.cpp An error will be reported.
I don’t understand the rules very well. Can someone explain it to me?

為情所困
為情所困

reply all(2)
PHPzhong

First of all, the former means that you want to use this class. Considering that during the compilation process, you can use this class and function as long as there is a declaration of the class and function. When linking, the linker will look for the definition of the class and function in other files. In the latter, you do not have a declaration of the class implemented by a.cpp. The compiler does not know this class, so a compilation error occurs.

世界只因有你

It’s written more clearly here, you can understand it
http://blog.csdn.net/praker/a...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template