Introduction to C++

Jake Cutter
Technology Hits
Published in
2 min readDec 17, 2020
Photo by Tianyi Ma on Unsplash

Like many other programming languages, it uses many of the similar tools that others like python and Java use. Strings, arrays, matrixes, you name it are all similar across it. You can find a python introduction here. The difference with C++ is the different libraries and notation. When using pointers, which is another way of saying a memory location of a variable (I’ll get into this further down), they utilize * and &. The most different part is when using the *, it can either mean a dereference operator or a variable location at a memory location. Libraries such as iostream, string, and limits differ from other C languages. The different languages are convertible but take some work to make it happen.

C++ Pointers:

As stated above, a pointer is something that gives the memory at a location. Memory is what is used up by the computer.

*, the dereference operator can assign something a value at a given location.

& — This is the address of the operator. It gives you the memory address.

The * and & are similar to multiplying and dividing. They can be used together to get to the same answer. An example of a memory address is abc4554d. The location abc4554d has a value you plugged in, 5. So *ptr = 5.

Libraries:

Assigning a library to your program is previous code that someone else already made. It allows you to be able to just have all their code on yours.

#include <iostream>

Input checking may also be different using a loop with <limits>

--

--