I need to copy character data from one class A to another class B.
In Class A, I defined a character variable: char v1;
In Class B, I defined another character variable: char v2;
In Class A, I read v1 from a txt file and want to copy it to v2 by using strcpy:
strcpy(OB.v2, v1); //OB is an object of Class B
but I always got error message:
"Access violation at address 0049A755 in module 'Copythem.exe'. Write of address 0000204."
It looks a pretty simple process and I have no problem to copy numeric data, but I couldn't figure out what causes this problem of copying character data.
Can any one give me a hint on the error source?
Thank you in advance!