-1

I wrote a random code to study for an exam and test some stuff in our subject out, my entire code is working properly except one part that is statement, that the cin st works properly but the compiler does not execute getline function, here is my code:

#include <string>
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
    string statment,st;
    cout << "enter a st : "<<endl;
    cin>>st;
    cout<<"enter a statment: "<<endl;
    getline(cin,statment,'\n');
    cout << statment << endl;

    return 0;
}

0 Answers0