how come 'scanf()' eliminates when it finds a '\n' in stdin in the first loop??? i thought it doesn't care about it
oh and here are some tips for your code :
those 3 functions :
Code:
int sort_bytes();
int create_screen();
int initialise_com_port();
should have the type 'void' not 'int' because they won't return any value. They will just do their stuff and quit their functions without returning any values.
When asking for single characters as input , use two cases for each character instead of one coveing both lower-case and upper-case letters. So this :
Code:
case 'C' : printf("\nFunction sort_bytes and function create_screen");
printf(" is called in.");
should be :
Code:
case 'c' :
case 'C' :
printf("\nFunction sort_bytes and function create_screen");
printf(" is called in.");
you checked for only upper-case letters when people mostly type lower case letters by default.
another thing , you can go to other lines in your program with using only one 'printf()' instead of typing it again on each line. It can be done this way :
Code:
printf("First line\n"
"second line\n"
"third line\n");
and finally , you've included 2 useless header files , conio.h and process.h. You've only used functions that are declared in stdio.h so it should be there alone.