shadowsilver
Programmer
Does anyone know if there is a way to send arguments to a constructor and not have to use a local copy to transfer them to their rightful homes?
Like:
class Person {
int Hlth, Att, Def;
string Name;
Person(int InitHlth, int InitAtt, int InitDef, string InitName);
}
Is there another way to do it than this? It seems sorta redundant.
Person:
Hlth = InitHlth;
Att = InitAtt;
Def = InitDef;
Name = InitName;
}
Person Me(50, 10, 2, "Bob"
Can you do it with references or pointers? I haven't had any luck... I've tried like Person: