My C++ Learning
Saving the process of my_C++_Language_learning I am a student who major in Software Engineering in Hunan Normal University. I make this Repository to help me learn C++ language better.
- Which IDE(integrated development environments) I use? I use CLion and g++, but I often use g++ which isn't a IDE.It is a compiler. As you can see, Visual Studio C++ need about 6G's room. However we need not use all of this tool.
- Which book I use to learn C++ language? Proclaim: In our class, only me use this book C++ Prime Plus .
- You can use macOS and Windows to compile source code. Linux is also a good choice.
Because I like using Command line and prefer to sample GUI, I use macOS and Ubuntu instead of the popular operation system, Windows. It means that I am not familian with command line in Windows.
macOS and linux platform
As you can see I use Terminal and g++ to compile source code. Here are some detials on how to make a file which includes source code and how to compile it.
Step 1 : make files
Open the Terminal, and enter the following command line
cd ~/Documents # change directory to "Documents" mkdir C++_Project # make directory C++_Project ps. you can rename it cd ~/C++_Project # change directory C++_Project touch xxx.cpp # make file to save source code Notice： "xxx" is the name of this file , you can name it what you want.
Step 2 : Edit the file you make
In command line, you can use
nano, I don't like use those. I use
(I recommanded you install airline if you like using vim)
Step 3 : Compile the source code
Making sure that you have install g++ or gcc, In the Terminal, you can enter this command line
gcc -version to know which version you have installed.
Changing directory to where your source code file is. And then use this command line -
g++ xxx.cpp to compile source code.
The "xxx.cpp" is the name of your source code file.
ls,you can see a new file which name is "a.out". Last use command line
./a.out to run it.
Notice: We use gcc/g++ to compile source code. Some detials is very important.
You can also download the sources code of gcc and compile it.Sometime the version , which the system installed is too old,and you compile some projects that need heigh version to compile,you can do this.
As for Windows platform
You can install IDE , such as Code::Blocks 、 Qt