Greetings!
Well, everybody says goto is not a usable keyword. That seems to be everyone's opinion. Yet, it is defined as standard in most languages: including C and C++ code. What's the real story? Is goto REALLY not usable?
Before you start calling me a dinosaur, take a look at these lines:
[code]
int main()
{
while(1)
{
CheckTemperature();
CheckControls();
SoundAlarm();
}
}
[/code]
Embedded systems use these much: a never-ending tasklist. Another option is the for loop, but not all compilers accept:
[code]
int main()
{
for(;;)
{
CheckTemperature();
CheckControls();
SoundAlarm();
}
}
[/code]
A goto suggestion:
[code]
int main()
{
tasklist:
CheckTemperature();
CheckControls();
SoundAlarm();
goto tasklist;
}
[/code][b][/b][b][/b]