I am starting to learn C for use with a small AVR single board computer. The board came with C code examples and I am learning how C works by modifying the code and adding sections etc.
I am stuck with use of the "If" decision making. I have a book and have also tried to follow the example on the tutorial here.
Rather then put all my code down I have abbreviated a lot, sorry for this but I am more interested in the programme flow. I have attached an jpg image of the wanted flow control with the continues all going out of the if block.
Below is my attempt at replicating it in C with what I believe is the correct formatting.
My question is, am I correct? There may well be a better way and I would love to see it but for now yes or no and if no where have I gone wrong. Sorry for the long pre-amble.
Code:if (a) { if (b){ do 1; continue; } else { if (c){ if (d) { do 2; continue; } else { continue; } } else { if (e) do 3; else continue; } } } else continue;
Cheers
Adrian