Personally i dislike using string variables and use charracter arrays instead
To see what an array is visit the tutorial(this will help the understanding of using the array).
. But for this purpose s is a string with a limit of 50 characters, and s1 is a string with a limit of 150 characters.
See what happens with it like this.
The person who posted above used cin to input the sentence. Cin does not read null characters(any type of space like a space or an enter).
Code:
--------------------------------------------------------------------------------
#include <iostream>
#include <conio.h> //for compiler
using namespace std;
int main()
{
cout << "Enter a word:" << endl;
char s[50];
cin >> s;
cout << "You Entered " << s << '\n';
cout << "Enter a sentence: \n";
char s1[150];
cin.getline(s1,150,'/n'); //reads spaces with getline and stops inpt
//when it reaches a '\n' (aka enter) the 150 is the max amount of
//chars that can be inputted
cout << "You Entered " << s1 << '\n';
getch(); // for compiler
return 0;
}