Hodor: why are my responses to your posts being blocked? Is that the way in which you conduct your discussions?
Hodor: why are my responses to your posts being blocked? Is that the way in which you conduct your discussions?
I am not aware of them being blocked. If they are indeed being blocked -- and I find that hard to believe since I have not put you on ignore -- then it has nothing to do with me
Hodor: I have had a prior number of equally daunting experiences - like your unpleasant response - using C Board. (I have had excellent responses as well! That is why I pluck up courage now and again, when I need to write in C, and have a query, to place a post.) The code I posted *worked*, only a particular strcpy in it didn't. That was what my query was about.
Just a word about using gotos: (now I have a chance to do so) if using gotos makes it possible to create a routine with very few lines, and it is well structured, and works, and it is transparent, I see no reason why not to do so. Imo a coding language is not a religion. It is a means to an end: no more.
That's true, but if you're writing well structured code with goto, it is usually the case that you can replace the goto with a specific control structure or helper function, thereby making your intentions clearer. The common exceptions to this in C would be using goto to keep error handling in one place (DRY principle: Don't Repeat Yourself), usually at the end of the function, or to break out of nested loops without introducing a flag purely for that purpose (but sometimes a descriptive flag can clarify the code).Originally Posted by Ivory348
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
In your original code the use of multiple gotos was not appropriate and it was certainly not needed. The use of goto in what you pasted obfuscated the code and made it unreadable spaghetti code. So, yes, I could not excuse the use of multiple goto like you asked us to because it made no sense. There are exceptions where goto is appropriate of course (especially in C where gotos are local jumps. But using goto to make a loop is not one of the commonly accepted uses)
Edit: Anyway, why are we discussing this here?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
C has now become a widely used professional language for various reasons.C is much more flexible and free-wheeling. This freedom gives C much more power that experienced users can employ.C BasicsIts main drawback is that it has poor error detection which can make it off putting to the beginner. However diligence in this matter can pay off handsomely since having learned the rules of C we can break them. Not many languages allow this. This if done properly and carefully leads to the power of C programming.
"without goto we would be wtf'd"