Why would "fopen(stdin,"rb")" fail?
- From: "David F" <David-White@xxxxxxxxxxxxx>
- Date: Mon, 20 Aug 2007 20:32:03 -0700
I am doing the following:
fclose(stdin);
FILE* fp=fopen(stdin,"rb");
The compiler complains as follows:
error C2664: 'fopen' : cannot convert parameter 1 from 'FILE *__w64 ' to 'const char *'
Since it has no complain about the fclose(), why would it complain about fopen?
My purpose is to check the input queue from keyboard, w/o waiting for the user
pressing Enter and actually w/o waiting at all - either there is a char in the buffer or not
so that I can also count a timeout.
Thanks,
David
.
- Follow-Ups:
- Re: Why would "fopen(stdin,"rb")" fail?
- From: Ben Voigt [C++ MVP]
- Re: Why would "fopen(stdin,"rb")" fail?
- From: Igor Tandetnik
- Re: Why would "fopen(stdin,"rb")" fail?
- Prev by Date: Re: replacing .bmp resource
- Next by Date: Re: replacing .bmp resource
- Previous by thread: Vista Home Basic
- Next by thread: Re: Why would "fopen(stdin,"rb")" fail?
- Index(es):
Relevant Pages
|