I found that std::endl means moving the cursor to new line and then flushing the cin buffer. but in this code , after using endl,getline doesn't work
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a,b;
cout<<"The first string is: ";
cin>>a;
cout<<"The second string is: "<<endl;
getline(cin,b);
cout<<"The second string you typed is: \n";
cout<<b;
}