I need to use some form of Sleep() to let the user stay with the speed of the program and watch things move around the screen. I have a problem with using any command that makes the program stop for a small amount of time but at least right now Sleep() seems like my best bet. I have included stdlib.h and accepts _sleep() and when I run the program it says to use Sleep() because its been superceded by a new library. and within stdlib.h Sleep() does exist too. I'm at a complete roadblock any advice is much appreciated! (Different from the 2017 errors because I'm using 2019)
code:
void startGame() {
//bool flag = true;
for (int a = 0; a < 10; a++) {
screenUpdate();
for (int i = 0; i < 4; i++) {
rowsShown[i]++;
}
Sleep(500); // this comes out with an error
//to show what the other one does
_sleep(500);
}
}
Errors:
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "Sleep" is undefined
Severity Code Description Project File Line Suppression State
Error C4996 '_sleep': This function or variable has been superceded by newer library or operating system functionality. Consider using Sleep instead. See online help for details.