Wpis z mikrobloga

#naukaprogramowania
To teraz jak to mógłbym zamienić funkcje na wątki? Mam zrobić aplikację wielowątkową i nigdy tego wcześniej nie robiłem.

#include
#include
#include
#define SIZEA 40
#define SIZE
B 108

char c;
void cursorposition(int x, int y)
{
::HANDLE hConsoleOut =::GetStdHandle( STDOUTPUTHANDLE );
::CONSOLECURSORINFO hCCI;
::GetConsoleCursorInfo( hConsoleOut, & hCCI );
hCCI.bVisible = FALSE;
::SetConsoleCursorInfo( hConsoleOut, & hCCI );
HANDLE h = GetStdHandle(STDOUTPUTHANDLE);
WORD wOldColorAttrs;
SetConsoleTextAttribute(h, BACKGROUNDBLUE | FOREGROUNDINTENSITY);

int i = 0;
int j = 0;
for (j = 8; j=SIZEB-8) x = 8;
else if (xold<=8) x=SIZE
B-9;
if (yold>=SIZEA-8) y = 8;
else if (yold<=8) y=SIZE
A-9;

cursorposition(x, y);
}
}

int main()

{

printf("\n\n\n\n\nW: UP S: DOWN A: LEFT D: RIGHT");
char c;
if (_kbhit())
c = getch();
direction(c);
return 0;
}
  • 2