When we are coding with java we can have reference variables that are not assigned to any object.
Example :
Player p1
here p1 is assigned only if we create an object like below :
p1 = new Player();
Here p1 stores the address of the newly created Player object.
If we create a variable in c++ like this, it is also creating a new object.
Example :
Player p2
p2 here assigned to a new object. That way we cannot have any variable only of some type.
Also we can create pointers to the object as following,
Player* p3 = new Player();
If both(p2 & p3) are holding addresses,
i) What use of pointer(p3) of that type?
ii) How can we just create variables to a type ?