i am kind of stuck with ->
i know its accessing the class member but why would you make it a pointer and not just use .
example 1:
//////////////////////////////////////////Code:class myclass
{
public:
int t;
};
int main()
{
myclass myclass;
myclass.t = 1;
return 0;
}
example 2:
class myclass2
{
public:
int t;
};
int main()
{
myclass2 *myclass2;
myclass2->t = 1;
return 0;
}
what is the diference then with -> , and why do you have to
make a pointer to use it