English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

can someone give a detailed step by step account of select() I/O in C?

2007-09-09 12:15:06 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

1 answers

Hi,
If u are asking about the counterpart of Select statement in C, then here it is,

switch(a)
case 1:
printf("a has got value 1 so only this part will be executed."
break;
case 2:
printf("a has got value 2 so only this part will be executed."
break;
case 3:
printf("a has got value 3 so only this part will be executed."
break;
case 4:
printf("a has got value 4 so only this part will be executed."
break;
default:
printf("a has got any value other than 1, 2, 3 or 4 so only this part will be executed."
}
break; statement is required, otherwise it will execute all the following case: statements. e.g., if a=2, then it will start from case 2:. it will execute case 2:, case 3:, case 4; default: and then come out. If one uses break: then flow comes out of switch after executing relevant case only.

2007-09-09 18:33:15 · answer #1 · answered by iqbal 4 · 1 0

fedest.com, questions and answers