I m using MinGW for running g++ compiler on windows. Whenever I run the following code, it the compiler gives strange results.
Code:
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
    int n;
    string a;
    cin>>n;
    getline(cin,a);
    cout<<a;
    return 0;
}
No problem occurs when I compile the code. But as soon as I run the code and give input for n, it never asks for the input of a and ends. I m using MinGW 5.1.6, is there any problem with that or is there any problem with my code?