Before anyone asks, yes, this is part of a homework, and yes, I did a lot of Googling before asking. I spent the last hour searching intensively on Google with many, many different keywords, but just could not find anything.
So here goes the question :
What does the following variable definition mean: class MyClass* myClass;
?
I tried that code with something like class MyClass* myClass = new MyClass();
and found that it simply creates a pointer to a new instance of MyClass
.
So, what's the advantage of using the class
prefix? Does it make any difference?
Does someone have a link to some resources about it? I simply could not find anything (it's really, really hard to find things other than "class definition"!).
Thanks a lot!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…