Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help on using end=

Status
Not open for further replies.

1capybara

Technical User
Jul 6, 2002
18
US
my c++ class doesnt give any info about this legacy c
function. could someone pls give a simple example of its use, which ive heard is sort of like this:
goto labelname;
could i also write
end= labelname ??? TIA, capybara. :)
 
hi,

If your question is about use of goto, probably
this may be enough


printf( "1\n" ) ;
printf( "2\n" ) ;
goto mylabel ;

printf( "3\n" ) ;
printf( "4\n" ) ;

mylabel:
printf( "5\n" ) ;


Probably in your examples the label was named "end" that
is not a keyword in C.


Many people dislike use of goto, but this is a storic problem.
In years '70 language as BASIC, FORTRAN required use
of goto.

When languages as: PASCAL, new version of BASIC, FORTRAN,
came out, the purists sayd that goto was to forget.

I think is bad the abuse of it, but using it rarely and
in particular situations, may give to your program
a better read-bility.

However remeber that in C there are also statement as:

break, continue, return: you must use them before use goto.

In PASCAL such statements are not, and if you want avoid
big if 3 pages long, a "goto end" is required.


BYE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top