Hirdetés

2024. június 3., hétfő

Gyorskeresés

Hozzászólások

(#4050) krisztianAMG


krisztianAMG
senior tag

Sziasztok!

Suliban kaptunk egy ilyen kiinduló anyagot, amit tovább kellene fejleszteni:

#include "stdafx.h"
#include <stdio.h>
#include <time.h>
#include <conio.h>

int main()
{
unsigned char ch=0;
do {
if(_kbhit())
{ ch = getchar();
switch(ch)
{
case 0x00: printf("\n[Fx] code:");
printf("%d\n",getchar());
break;

case 0xE0: printf("\n[Xx] code:");
printf("%d\n",getchar());
break;

case '1': printf("Ahoj");
break;
case '2': printf("Hello");
break;

case 13 : printf("\n");
break;

default: printf("%c",ch);
}
}
} while(ch != 27);

printf("\n\nVege...\n\n");
return 0;
}

A normál gombokat beolvassa gond nélkül, de az F1,F2,... ESC és tsa. már nem megy át. Hol a hiba? Mit nem veszek észre?

Copyright © 2000-2024 PROHARDVER Informatikai Kft.