Car class misunderstanding problem

So I have been looking at some old codes to help me with my studies and came across the Car Class Programming in the following link.

http://www.cplusplus.com/forum/general/83712/

I'm a newb and just would like clarification to the reply "You need to create a Car object and call it using that". Where should the car object go in this code example? I've never dealt with classes and constructors and although I have read up on them, I cant seem to grasp this part of this code.

Any help would be appreciated.
They mean that in order to call any of the member functions of that class (like getYear(), etc), you must have an instance of that class.

 
getYear(); //get the year or which car?? 


1
2
Car some_car; //make a car using the default constructor
some_car.getYear(); //get the year of some_car 
Last edited on
Thanks, I see so this works...

1
2
3
        Car Temp;
	Temp.getDisplay();
        //getDisplay(); 


Some times it takes a little work and help, thanks again.
Topic archived. No new replies allowed.