Saturday, May 22, 2010

How can we use 'goto' with try...catch in C#.net?

You know, I had thought that MS axed the GOTO in .NET.





Also, it depends on what you want to do and where you are placing the GOTO. I mean, if you use a GOTO at any place in the code, you will jump to wherever you tell it. I'm not entirely sure if it will create a memory leak if you use it within the CATCH block... certainly, you shouldn't use it in the TRY block...





In all reality, though, you really should avoid using GOTO as a control structure... it died with QBASIC, dontchyaknow...


No comments:

Post a Comment