#include <iostream>
#include <string>
usingnamespace std;
// your code here
int main()
{
char charstring[50];
cout << "Input a character string for printing:";
cin.get(charstring, 50);
PrintClass printer;
printer.Print(charstring);
}
So , I try to write a class and enter there before main program, but something is always wrong!
Even though the two variables are both named charstring they both refer to different memory locations. Try replacing your print function with something like: