Let’s examine code (in C++) below:
Take a look at the code below. It’s pretty basic, so even if you don’t know C, you should be able to understand it.