i have a question about goto statements. i have a program with a loop with multiple if statements inside. i got rid of the loop and started it with - begin main: - then at the end of the if statements i put - goto begin main; -. will this work? its all in the same int main() block but the goto begin main(s) are in the if blocks.
i was just trying to take new things i learn and use them. i was having run time errors and this seemed to use less code. i was i wanted to make it would and the book im reading only gave me about 2 paragraphs of info on it.
It probably uses more code. The compiler knows how to make loops nice and tight. When using goto, you throw away all kinds of optimization information.
remember:
Google around "goto" and you'll learn why there were only two paragraphs on it in your book. Hopefully one of those paragraphs plainly stated that goto is almost never the right thing to do.