Welcome to the C++ Introduction Homepage, mate!


C++ Introduction Information

C++ is a general purpose object oriented programming language that was developed by Bjarne Stroustrup back in 1979 at Bell Labs.
C++ is capable of running on a variety of platforms including Windows, Mac OS, and the many versions of UNIX.
C++ has served as an influence for many programming languages such as C#, D and Java.

Unlike C# and Java, C++ is not a memory safe language.
C++ is not considered memory safe because it allows pointer arithmetic and doesn't have an implicit garbage collection unlike C# and Java.
C++ got its name since it is considered one step ahead of C. The ++ implies an increment of 1, and thus C++ is considered an incremenation of C.

To get started coding, you will need to download an IDE(Integrated Development Environment) located here

https://codelite.org/

Now that you have a coding environment, let's check out a simple hello world program!

Hello World

#include <iostream>

int main() {
   std::cout << "Hello World";
   return 0;
}

Output

Hello World

Notice that std::cout? There's an easier way to write console output by adding using namespace std like so!

Hello World With Namespace

#include <iostream>
using namespace std;
int main() {
   cout << "Hello World";
   return 0;
}

Output

Hello World

Notice how much how easier that it is to type? You're accomplishing the same thing with less work.

I'll break down what's going on here down for you

  • using: You are going to use it
  • namespace: To use what? A namespace
  • std: The std namespace (where features of the C++ Standard Library, such as string or vector, are declared).



Syntax

Next, we will discuss the syntax of C++.