setjump and longjump

P

pal

hi all,


Can anybody explain about setjump and longjump functions if u have
time to spend on this.

Thanks,
pal
 
R

Ravishankar S

pal said:
hi all,


Can anybody explain about setjump and longjump functions if u have
time to spend on this.

it is "setjmp" and "longjmp". they provide (among others) a method to do a
non-local goto (goto across functions). any good
C textbook can provide with an example.
 
S

steve.pagliarulo

hi all,

Can anybody explain about setjump and longjump functions if u have
time to spend on this.

Thanks,
pal

setjmp and longjmp are very old and are a primitive a form of
exception handling (conceptually). They definitely should not be used
in new code.
 
J

J. J. Farrell

setjmp and longjmp are very old and are a primitive a form of
exception handling (conceptually). They definitely should not be used
in new code.

Why not?
 
E

Eric Sosman

setjmp and longjmp are very old and are a primitive a form of
exception handling (conceptually). They definitely should not be used
in new code.

They should definitely not be used in most code, but when
they're needed in code new or old, they're the only mechanism
available for the task.

Are you, perhaps, thinking of That Other Language?
 
S

steve.pagliarulo


I should qualify that answer with "unless you have no other choice."
They are simply one of the the biggest hacks ever made. Understanding
the problem might allow suggestions for better solutions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

setjump problem 3
Restarting my program 14
Assigned gotos in standard C 14
setjmp/longjmp 2
longjump 14
Cannot convert (double) to (double*) 1
Sending data from web page to Raspberry Pi 0
Using getchar and putchars 3

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top