Added some more information (#27749)
This commit is contained in:
committed by
Christopher McCormack
parent
f40c83cae6
commit
99906d2589
@ -6,7 +6,7 @@ title: C++
|
|||||||
## What is C++?
|
## What is C++?
|
||||||
|
|
||||||
* C++ is a general purpose programming language which has been used since the 1990's
|
* C++ is a general purpose programming language which has been used since the 1990's
|
||||||
* It was designed by Bjarne Stroustrup under the name "C with classes".
|
* It was designed as a thesis paper by Bjarne Stroustrup under the name "C with Classes", which later became C++.
|
||||||
* It is a version of C that includes Object-Oriented elements, including classes and functions.
|
* It is a version of C that includes Object-Oriented elements, including classes and functions.
|
||||||
|
|
||||||
* It is considered one of the biggest programming languages, as you can see in the following image:
|
* It is considered one of the biggest programming languages, as you can see in the following image:
|
||||||
@ -20,7 +20,7 @@ _source: Github_
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
cout << "Hello World" << endl;
|
cout << "Hello World!" << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -41,8 +41,8 @@ Now, let's break down the code:
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
```
|
```
|
||||||
|
|
||||||
* The first line tells the computer to use the "iostream" header file for this specific program. A header file is a separate file with prewritten C++ code. There are many other header files which are required for a specific program to run properly. For example, math, vector, string, etc. Header files are generally represented by a ".h" extension, when including standard library header files you don't include the ".h" extension.
|
* The first line tells the computer to use the `iostream` header file for this specific program. A header file is a separate file with pre-written C++ code. There are many other header files which are required for a specific program to run properly. For example, `math`, `vector`, `string`, etc. Header files are generally represented by a `.h` extension, when including standard library header files you don't include the `.h` extension.
|
||||||
* The `iostream` header contains the public interface for the input-output stream from the standard library. The "iostream" file contains code for allowing the computer to take input and generate an output, using the C++ language.
|
* The `iostream` header contains the public interface for the input-output stream from the standard library. The `iostream` file contains code for allowing the computer to take input and generate an output, using the C++ language.
|
||||||
* The second line tells the computer to use the standard namespace which includes features of standard C++. You could write this program without this line, but you'd have to use `std::cout` instead of `cout` and `std::endl` instead of `endl` on line 4. It makes the code more readable and our lives as programmers easier.
|
* The second line tells the computer to use the standard namespace which includes features of standard C++. You could write this program without this line, but you'd have to use `std::cout` instead of `cout` and `std::endl` instead of `endl` on line 4. It makes the code more readable and our lives as programmers easier.
|
||||||
|
|
||||||
#### Line 3 and 4
|
#### Line 3 and 4
|
||||||
|
Reference in New Issue
Block a user