kidzsearch.com > wiki   Explore:images videos games

# C++

Jump to: navigation, search
Paradigm(s) Multi-paradigm:[1] procedural, functional, object-oriented, generic 1983 Bjarne Stroustrup Bjarne StroustrupBell LabsISO/IEC JTC1/SC22/WG21 ISO/IEC 14882:2011 / 2011 C++14 / 2014 Static, unsafe, nominative ISO/IEC C++ 1998, ISO/IEC C++ 2003, ISO/IEC C++ 2011 C, Simula, Ada 83, ALGOL 68, CLU, ML[1] Perl, LPC, Lua, Pike, Ada 95, Java, PHP, D, C99, C#, Falcon Cross-platform (multi-platform) .h .hh .hpp .hxx .h++ .cc .cpp .cxx .c++
Bjarne Stroustrup, the creator of C++

C++ (pronounced "see plus plus") is a computer programming language. It was created for writing programs for many different purposes. In the 1990s, C++ became one of the most used programming languages.

The C++ programming language was developed by Bjarne Stroustrup at Bell Labs in the 1980s, and was originally named "C with classes". The language was planned as a better version of the C programming language and it added features like class orientation, a branch of object-oriented programming. Step by step, a lot of advanced features were added to the language, like operator overloading, exception handling and templates.

## Example

The following text is C++ source code and it will write the words "Hello World!" On the screen when it has been compiled and is executed.

#include <iostream>
using namespace std;

int main()
{
cout << "Hello World!";

return 0;
}


The following text is C++ source code and it will add 3 + 2 and then writes the answer on the screen where it has been compiled and is executed.

// Iostream is the input and output stream; which stores functions such as print etc.
#include <iostream>
// Namespace std; is the standard namespace which also stores some functions
using namespace std;

// We are now creating an important instance; the main function
int main()
{
//Cout means character output stream
cout << 3 + 2;
//Return is not needed. All it does is tell the computer that the code was executed successfully; by sending a zero
return 0;
}


The following text is C++ source code; and it subtracts, multiplies, divides and then write the answer on the screen where it has been compiled and is executed.

#include <iostream>
using namespace std;

int main()
{

int a = 5;
int b = 10;
int c = 20;

cout << a-b-c;
cout << a*b*c;
cout << a/b/c;

return 0;
}


## References

1. Stroustrup, Bjarne (1997). "1". The C++ Programming Language (Third ed.). . .