Array and functions usage with Classes

class here
{
public:
int a;
int b
void usr();

}hello[10];

my main problem is to call the function, normally it would be hello.usr(); but because its an array it is not that but hello must be an array because i want a and b to be an array value, any way using this code and not changing a, b into arrays seprately?
hello[0].usr();

or for a pointer

hello[0]->usr();

EDIT:

You have a missing semicolon after int b

Also, you should keep class variables private: and use getters/setters ... good practice,
Last edited on
Topic archived. No new replies allowed.