Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

meaning of warning C4996

Status
Not open for further replies.

raydona

Programmer
May 12, 2005
27
GB
I get the following compiler warning:
Warning C4996: 'kbhit' was declared deprecated
‘kbhit’ was used in the following code:
int s = 0;
time_t now, expire;

cout << "Enter integer: ";
expire = time(NULL) + 8; //wait for 8 seconds
now = time(NULL);
while (!_kbhit() && now < expire)
{ now = time(NULL);
}
if(kbhit()) cin >> s;
else return;

I would be grateful if someone could tell me what the warning means and how do I get rid of it.
 
Go on google and search for "C4996" and you'll find a ton of examples including some from the MSDN. I find it easier sometimes to google first and click on the MSDN link it finds rather than searching directly from the MSDN site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top