I have defined a class,
Aims: simulate the string but with more functionalities
class ex_char
{
public:
ex_char(char *input):len(strlen(input)){strcpy(str,input);}
...functions...
private:
char *str; //where the char array is saved
int len; //length of the char array
};
For a normal char array, we can use:
char charray[10]="String";
cout<<charray;
to show the content of the char array
But how can I show the content of my class's str property by
cout<<excharray;