+ 1

How to store a string/word in a variable in Turbo C++?

Since the 'string' variable is not working in Turbo C++. It displays error message as the program does not recognize 'string' as a variable.

12th Aug 2017, 2:46 PM
Bhakta
Bhakta - avatar
3 odpowiedzi
+ 3
can I see your code buddy? I hope that after looking your code then only I can say anything 😊
12th Aug 2017, 3:04 PM
Mac
Mac - avatar
0
Sure ! The code is as follows : #include<iostream.h> #include<string.h> class MyClass { public: string name; }; void main() { MyClass myObj; myObj.name="Sololearn"; cout<<myObj.name; } The problem here is that the string variable is not working 😟 ?!
12th Aug 2017, 3:22 PM
Bhakta
Bhakta - avatar