C Programming Tutorial 10, Switch Structure

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Switch statements are a lot faster than if/else structures because at compile time the cases are sorted so that the case can be matched through a binary search.

iTzAdamX
Автор

you are amazing ADAM i am learning a lot through these you so much

muhammadshakeeb
Автор

Could you rewrite the code for the calculator made earlier in the series, using this sequence?

Torcika
Автор

I don't know, but the easier way to do that would be to convert myChar to lowercase.

Grkgermn
Автор

Another way than the one Grkgermn333 suggested, is to put something like this:

case 'A':
case 'a':
//code

The code will execute even if the char is a capital A.

InfiniteFacepalm
Автор

if im creating a project in C off of the hello world and GCC compiler why whenever i run a program it end up always saying hello world no matter what code i put in? 

michaelarcilla
Автор

why did we use directly scanf after int main( ) !?

fadifadi
Автор

Congratulations. I'm sure everybody else did, too.

Grkgermn
visit shbcf.ru