From your question it appears that you are learning C and you are a newbie in programming in general. If this is the case, I strongly suggest you to follow a good book. C is not a good language for a newbie to simply learn by doing. It has tons of pitfalls and it is very easy to add a comma or semicolon in the wrong place and have a perfectly functioning (i.e. compiling and running) program that does nothing of what you expect! C doesn't hold your hand like, say, Java or Python.
As for your question, this reference could be useful.
Another advice: play with goto
to learn its syntax and semantics, then try to avoid using it in "real code" until you become an expert C programmer. Almost any program can be created without goto
s. When an expert programmer resorts to goto
s is probably because either:
- it's implementing some optimization trick, or
- the algorithm at hand is so tricky that falls in one of those rare cases where
goto
makes the code more readable.