On Tue, 20 Feb 2001 14:51:43 +1100 (EST), Jason Rennie wrote:
>I guess i'm a sloppy programmer then, i stick exit()'s in code when I have
>some nasty fail error, sinply becasue it is easy to see where it was up
>to, and the exits live with the broken peice of code :)
Well here is one circumstance where (IMO), it is quite OK to have
gotos,
viz:
afunction()
{
int ret = 0;
switch(whatever)
{
case x:
if((ret = dosomething()) == 0 )
goto fail;
case y:
if((ret = dosomethingelse()) == 0)
goto fail;
}
fail:
return(ret);
}
gotos should be used when they make sense, I reckon they definately
have their place.
Regards
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug
- [SLUG] That somewhat theoretical problem. Bill Bennett
- Re: [SLUG] That somewhat theoretical problem. Terry Collins
- Re: [SLUG] That somewhat theoretical problem. Steve Kowalik
- Re: [SLUG] That somewhat theoretical problem. Jason Rennie
- Re: [SLUG] That somewhat theoretical problem. Raoul Golan
- Re: [SLUG] That somewhat theoretical problem. Jason Rennie
- Re: [SLUG] That somewhat theoretical prob... Peter Faulks
- Re: [SLUG] That somewhat theoretical problem. Jon Biddell
- Re: [SLUG] That somewhat theoretical problem. James Wilkinson
- Re: [SLUG] That somewhat theoretical problem. Ken Yap
- Re: [SLUG] That somewhat theoretical problem. Andrew Bennetts
- RE: [SLUG] That somewhat theoretical problem. Jill Rowling
- RE: [SLUG] That somewhat theoretical problem. Jill Rowling
- RE: [SLUG] That somewhat theoretical problem. Rick Welykochy
- Re: [SLUG] That somewhat theoretical problem. Tom Nott
- Re: [SLUG] That somewhat theoretical problem. Peter Faulks
