You need to use a member initialization list to initialize your class members:
CHARBOX(int posx, int posy, int width, int height, int colour):posx_(posx),posy_(posy),width_(width),height_(height), colour_(colour)
{
}
Good Read:
What is this weird colon-member (" : ") syntax in the constructor?
someone advised me to name my class variables with a special symbol attached.
That is so that you can distinguish between the member variable name and the passed function argument name. It is not a necessity you can simply choose different names and it should be just fine.
why does it make sense to the program?
Constructor in C++ is a special member function which gets called whenever an object of the class is created. The purpose of the constructor is to provide an opportunity to properly initialize the members of the object. for e.x: width_, height_ etc in your case.
Once the object is constructed, the class members are assumed to be in valid and determinate state so that they can be used by the program. In your case unless you initialize the members in the constructor they will have indeterminate values i.e: any random values. You don't really want a member function to get the width_
and it to return a garbage value. So you need to initialize them.