The first day of learning vc ++ - compiled header files +

Because a little c # very familiar ... so want to learn about other programming languages ​​....

I use vs2019 ....

arx set the environment too much trouble, although it would like to use the secondary development cpp, but very difficult, so I start with basic grammar began to practice, I was able to use cpp reached first ...

Before ever I thought they would not like c # line and as strong, but later found not to later tried ......

Sure enough, strong line and there is no good end .....

 

The most important thing to learn is to practice, even though they have learned c #, but cpp or novices ...

I see that video B station   https://www.bilibili.com/video/av68697716?p=7

 

#Include the header file copy something equivalent to paste the cpp file

For example: ah

}

a.cpp

int Multiply(int a, int b)
{
    int result = a * b;
    return result;
#include "a.h"

Such braces will be copied to the back a.cpp} ... then the compiler will be successful;

Authentication method is https://www.bilibili.com/video/av68697716?p=6

08:11 shown inside the project properties inside this location was changed to "Yes", and then compile the .i file, open look on it

 

 

C ++ text feels freer? Unlike c # that can not be merged feeling .... This issue has been brought to me to learn to dynamically compile c ++ above .... first dig a hole ....

 

#Pragma once the pre-header file equivalent to the following

#ifndef  STUDENT_H   // Here's name and the same file name, meaning if it does not contain
 #define  STUDENT_H   // define a new macro
                   // then run here ... (function declarations like ....)
                   // This prevents references the header file, duplicate copies of the function declaration to other CPP, causes an error preventing function redefined ..
#endif 
// qt like to use this form

 

Then know if the judge sentences constant folding occurs, the compiler will throw away the judgment is positive useless code ... wonderful ah !!

 

ctrl + F7 to compile a .cpp file .obj files to be used to detect whether the compilation is successful,

Learn the obj file is a process file, a bunch of obj files compiled into .lib file.

cpp-> obj-> lib-> exe and dll .....

 

Contacted, static as modifiers of this document can be variable can also be a function of ..... on usage and c # starker .....

Usage and analyze static and extern both keywords from:  

https://www.jianshu.com/p/9ad8d3e8d2aa

https://baike.baidu.com/item/extern/4443005?fr=aladdin 

Guess you like

Origin www.cnblogs.com/JJBox/p/12535958.html