I seek the advice of the professional programmers yet again. I'm working on a bit of a text editor. Since I've never taken any data structures classes, nor have I worked with massive amounts of data, I like to know if this sort of coding would cause random errors or other undesired results.
I tried that _bios_keybrd stuff, but it took way too much code and was too cumbersome to deal with. Then I found this sort of thing doing a search on the board. I tried it and liked the results. Any comments would be greatly appreciated.Code:unsigned key1, key2; key1 = getch(); if(key1 == 0) { key2 = getch(); switch(key2) { /* process whatever special key */ } } else { key2 = 0; /* just in case */ key1 = (char)key1; putchar(key1) /* echo the input at current cursor pos */ }
TIA