This is one of the problems I get after first lesson on programming basics lecture
gets() works kinda properly(I think), but "cin" refuses to work
int main(void)
{
char *s1, *s2;
puts("Enter your name and surname for gets()");
gets(s1);
puts("Enter your name and surname for cin()");
cin >> s2;
cout << s1 << "! Hello from gets" << endl;
cout << s2 << "! Hello from cin" << endl;
return 0;
}
I expect cin to output what you had typed in console, but after typing programm waits for a second and then everything closes without any output at all.
Screenshot is what our teacher gave us and it's not working