#include <iostream>
using namespace std;
int main()
{
char str[100];
int n;
cin>>n;
std::cin.get(str, 100);
cout <<str;
return 0;
}
when i use cin.get() at first it works but it is not working if i use it after taking some inpute
#include <iostream>
using namespace std;
int main()
{
char str[100];
int n;
cin>>n;
std::cin.get(str, 100);
cout <<str;
return 0;
}
when i use cin.get() at first it works but it is not working if i use it after taking some inpute