Question: How can I fix these errors? int main(void) { CONSOLE_SCREEN_BUFFER_INFO csbi; CONSOLE_CURSOR_INFO ci; HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(output, &csbi); if (!setWindowProperties(&output, &csbi, &ci)) { return
How can I fix these errors?
int main(void) { CONSOLE_SCREEN_BUFFER_INFO csbi; CONSOLE_CURSOR_INFO ci; HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(output, &csbi); if (!setWindowProperties(&output, &csbi, &ci)) { return 1; } Screen.width = csbi.srWindow.Right - csbi.srWindow.Left + 1; Screen.height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
if (!readGraphicsFromFiles()) { return 1; }
for (; city[width] != ' '; width++);
drawMenu(); // Initial start
GameState gs;
clock_t bombTimer = clock(), menuTimer = clock(), planeTimer = clock(); while (1) { // Main game loop
// if a key is pressed if (_kbhit()) { const enum KEY key = _getch(); //this line is giving errors
if (gameRunning && !gamePaused && key != ESC) { if (strlen(gs.currentWord) - 1) { if (gs.currentWord[0] == key) { gs.corTyped++; strcpy(gs.currentWord, gs.currentWord + 1); drawScene(&gs);
121 122 gameRunning = 0; Sleep (1500); system("cls"); Compiler (5) Resources ab Compile Log Debug | Find Results Close Line Col File 75 53 Message In function 'int main()': [Error] invalid conversion from 'int' to 'KEY' [-fpermissive] [Error] cannot convert 'char**' to 'const char*' for argument '2' to 'int loadGame(GameState*,const char*)' In function 'void gameOver(GameState*)': [Error] invalid conversion from 'int' to 'KEY' [-fpermissive] 117 C:\Users\emre5\OneDrive\Masast\Untitled11.cpp C:\Users\emre5 OneDrive\Masast\Untitled11.cpp C:\Users\emre5 OneDrive Masast\Untitled11.cpp C:\Users\emre5\OneDrive\Masast\Untitled11.cpp C:\Users\emre5 OneDrive Masast\Untitled11.cpp 68 236 53
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
