Home > Back-end >  Through in the constructor parameter set character pointer, give the name of the class type dynamic
Through in the constructor parameter set character pointer, give the name of the class type dynamic

Time:10-05

CodePudding user response:

The constructor to char * take off

CodePudding user response:

Remember the free memory in the destructor,

CodePudding user response:


Char * name=new... Amounts to a defined a name variable, and the member attribute name name as

Strcpy (name, strle + 1, name) at this time of the account name without is you just define the local variables of the
Warning is prompt you the name and the class itself attribute name may be you are confused by the

If on the first floor, the char * name=new char [... change name=new char [... good

When you really have a need to define a name and class attribute of the same name when the name variable
The name is your new variables defined, or pass the variables involved in
This - & gt; The name is the property
  • Related