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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -