Z
Zalek Bloom
I try to understand the cin object. The sample from the book:
#include <iostream.h>
#include <string.h>
int main()
{
char ch;
while ( (ch = cin.get()) != EOF)
{
cout << "ch: " << ch << endl;
}
cout << "\nDone\n";
return 0; */
}
Here is the output:
main <=== this is the value I entered
ch: m
ch: a
ch: i
ch: n
ch:
My question:
When c++ is waiting for my input?
I understand (I think) cin object but in this example cin appears in a
loop.
Any ideas what happens there?
Thanks,
Zalek
#include <iostream.h>
#include <string.h>
int main()
{
char ch;
while ( (ch = cin.get()) != EOF)
{
cout << "ch: " << ch << endl;
}
cout << "\nDone\n";
return 0; */
}
Here is the output:
main <=== this is the value I entered
ch: m
ch: a
ch: i
ch: n
ch:
My question:
When c++ is waiting for my input?
I understand (I think) cin object but in this example cin appears in a
loop.
Any ideas what happens there?
Thanks,
Zalek