I want a, to be read until user presses Ctrl+Z. But it does nothing. My guess is that it's visual studios fault, because when I press Ctrl+Z it shows ^Z in console. What should I do? here is my code :
#include <iostream>
using namespace std;
int main()
{
    char a[50], b[20];
    int n;
    while (1)
    {
        if (NULL == fgets(a, 50, stdin)) 
            break;
        cin >> b;
        cin >> n;
    }
    return 0;
}
 
     
    