#include<iostream.h>
#include<conio.h>
class String
{
char str[100];
public:
void input()
{
cout<<"Enter string :";
cin>>str;
}
void display()
{
cout<<str;
}
};
int main()
{
String s;
s.input();
s.display();
return 0;
}
I am working in Turbo C++ 4.5. The code is running fine but its not giving the desired output for e.g if i give input as "steve hawking" only "steve" is being displayed. Can anyone please help?