C++

Chris Huston
4 min readJun 16, 2019

--

What is C++ and where did it come from? It is a general-purpose programming language that is object-oriented. Often it is used in competitive programming. It was created at AT&T Bell Laboratories by Bjarne Stroustrup in the 1980s. And it is still used heavily today in a number of different areas. The C++ language comes from the C language. C++ is the superset of C language so a great comparison I heard is that C is to C++ as checkers is to Chess. This shows that you need more strategy while using C++ but can be super strong. C language itself is another structured programming language. Also, C++ is backward compatible which helps it sit right at home in other programs that use C.

Let’s talk about how we can write a C++ program. We first need to talk about the environment we need to write the program in. The first thing we need is a text editor. It just needs to be able to save the file as an.CPP or .C extension. Then the next thing we need is to get a compiler. This is pretty crucial as we need to convert what we write in the C++ file to machine language. This is part of why C++ is so strong. It compiles the language directly to machine language rather than using a different program as its run to convert to machine language then be read by the processor, it is already there for the processor to read.

Now, what do we need to do to actually write a C++ file? We need to have a header file to provide input and output for the document. Then like in anything else we have to declare and name a function we want to write. Then if we want to display a message we need to have a Standard character output device or for short std::cout. We also need a few more things so it would look like this: std::cout<<”Message you want to write”;. There is also a similar one for inputs which is the same except its input instead of output and looks like: std::cin>>”inputs”;. This is all great but let's take a look at some code, this is an array that is created in C++.

Now that we know the basics of writing the code for C++, let's talk a little bit about what all we can do with it. It has a lot of pros and even a whole lot of cons, but if we learn how to write it properly there are tons of applications we can use it for. One great example is probably how you are reading this post. A lot of people are probably reading this in Google Chrome, which is written with C++ in its core. Even if you are not reading this in Chrome, if you are reading this in Mozilla Firefox, it is the same, a core of C++. There are also ton’s of other applications that use C++ for something in their applications, for instance, the Adobe applications run on C++ a lot of the time. This is because C++ is a powerful language but also has some unreal speed.

One area that C++ is used a lot is in the gaming industry. Most console’s use C++ for their games and the engines for games and applications. Think of some of the popular games you might have heard of or played recently, likely they might have had some part of it written in C++. Some big names are games such as the Diablo series, as well as World of Warcraft including the older games in the series like Warcraft 3. All these popular games used this language because of the benefits it offered them and it would be hard to argue with how successful they are that they made the wrong choice and should have tried a different language. Part of why these games used it was because you have full control over some parts such as memory. This makes it ideal over some other languages that use a garbage compiler, but you also do have to keep track of the memory yourself.

In the end, I have great respect for the gaming industry and want to learn even more about C++ so I can try to make my own games. It is one of the best languages for it with even more uses outside of gaming because of how the language interacts with others as well. I highly advise looking into it more and learning it if given the chance.

--

--