Trying to study here and I have come across something my C++ book is not mentioning about class private variables.
My code:
.H
#ifndef HANNAH_H
#define HANNAH_H
class Hannah
{
public:
Hannah(int);
void printCrap();
private:
int c;
};
#endif // HANNAH_H
=====
CPP
#include <iostream>
#include "Hannah.h"
Hannah::Hannah(int num)
:c(num) //What is it called when code is put here? <- HERE!!!
{
}
=====
Look at where it says
:c(num) //what is this?
Well that question about says it all. Specifically, though, when you put something after the parameters but before the brackets on a class function, what is that called? I actually understand completely what is going on with the code and how to work it I just do not know the right definition for it. I want to study it more but I do not know what it is called.
The C++ standards committee is working overtime to make sure we can hide a lot of classic emojis in the code with legit looking syntax
make in c into a p, for example, and you can sneak a :P in there.