I understand that to use ctrl-z to signal EOF or EOT is generally outdated and not recommended, but I'm just curious about what's happening under the hood.
Say I have something like this in C++:
#include <iostream>
#include <string>
int main() {
while (!cin.eof()) {
string str;
getline(cin, str);
}
cout << "out of while" << endl;
return 0;
}
If I do abc[^Z][newline], the program still runs. Same for abc[^D][newline].
But if I input a line purely contains [^Z][newline], the program exists properly.
I understand it's likely that it's OS specific but I'm just curious about what's going on there.