+ 1

Error when getting string as input in C++

I declare a variable as String type and while getting the input it shows error after pressing enter. How do I declare the variable to accept steering values without getting any errors..?

11th Aug 2016, 2:24 PM
Giri Madhan
Giri Madhan - avatar
1 Réponse
+ 1
in the class to declare ex class string { char *name; public: string( char *s) // constructor { name=new char [strlen(s)+1]; strcpy(name,s); } };
11th Aug 2016, 2:53 PM
rahul lunagariya
rahul lunagariya - avatar