where you want to give memory u will use new keyword . When object is created u must give the memory to data member and member function . You need to allocated memory for that object first .