+ 1

What does #include MyClass.h means?

27th Oct 2016, 5:57 PM
Jaya
3 Respostas
+ 6
first of all, you can't apply #include MyClass.h. you need to change it like : #include "MyClass.h" It means, you created a new class(or file) for your project and you want to add it to your current source code. Its adventages are: -Simplication: Your code seems simple, readable and extendable. -Clarification: If you seperate your classes, templates, namespaces, etc., you can have more control over your code and it gives you better debug and test. Its disadvantaces are: -More complex build for beginners. -Ridiculous for simple programs like Basic I/O programmes, Single Class Projects, etc. -Sometimes (for likely to beginners) gives header problems like header duplication and "header won't find" problems For conclusion, be careful when you use header separation.
27th Oct 2016, 6:30 PM
Pamir Ünsal
Pamir Ünsal - avatar
0
好评
31st Oct 2016, 2:17 AM
wangliuyin
wangliuyin - avatar
0
# tells that the statment following it is a preprocessor. If MyClass.h exists and included with correct syntax, whole code of the file MyClass.h is copied into the program. #include "MyClass.h"
27th Nov 2016, 3:36 AM
Fahad
Fahad - avatar