c++ - creating and instantiating instances in the heap memory -
what missing here
class a{ private : string name; int seatno; public : void setname(string n){ name=n; } void setnumber(int number){ seatno=number; } }; int main( int argc, char ** argv ) { *a1=new a[10](); *a1[0].setname("name1"); return 0; }
i'm getting error
error: void value not ignored ought be
Comments
Post a Comment