Guest_imported
New member
- Jan 1, 1970
- 0
Ok, the thing is... I got the whole 'passing a reference' thing down. My problem is the whole gist of getting the correct data types in strcpy... This is essentially what my feeble mind is trying to do:
--------------------------------------------------------
void <classname>::setname(char &n){
strcpy(name,n); }
// from my main()
<classname> ob1;
char n[12];
n = "Jimmy"; //Just an example, im really going by user input
ob1.setname;
----------------------------------------------------------
I've also tried passing pointers... can anyone point out my flaw or tell me if this is even possible? Im so new at this!!
--------------------------------------------------------
void <classname>::setname(char &n){
strcpy(name,n); }
// from my main()
<classname> ob1;
char n[12];
n = "Jimmy"; //Just an example, im really going by user input
ob1.setname;
----------------------------------------------------------
I've also tried passing pointers... can anyone point out my flaw or tell me if this is even possible? Im so new at this!!