cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : C Library : csetjmp (setjmp.h) : setjmp
 
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
C Library
cassert (assert.h)
cctype (ctype.h)
cerrno (errno.h)
cfloat (float.h)
climits (limits.h)
clocale (locale.h)
cmath (math.h)
csetjmp (setjmp.h)
csignal (signal.h)
cstdarg (stdarg.h)
cstddef (stddef.h)
cstdio (stdio.h)
cstdlib (stdlib.h)
cstring (string.h)
ctime (time.h)
csetjmp (setjmp.h)
jmp_buf
longjmp
setjmp

-

setjmp macro
int setjmp ( jmp_buf env );
<csetjmp>

Save calling environment for long jump

This function with functional form takes its argument, env, and fills its content with information about the environment stat in that point in the code to be able to restore that state in a later call to longjmp.

Parameters

env
Object of type jmp_buf where the environment information is stored

Return Value

This macro may return more than once. A first time, on its direct invocation, in this case it always returns zero.
When longjmp is called with the information set to env, the macro returns again; this time it returns the value passed to longjmp as second argument.

See also

longjmp Long jump (function)
jmp_buf Type to hold information to restore calling environment (type)
© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us