#include <stdlib.h> void abort(void);
abort
terminates program execution abnormally.
Open files are not closed before termination.
abort
.
abort
without closing files, data in the
files may be lost. In addition, an open UNIX style output file
will be unchanged if you call abort
. See
I/O Functions for a definition of a UNIX style file.
abort
terminates by raising the SIGABRT signal. If a handler is
not defined for this signal, SIGABRT causes program termination with a
user ABEND code of 1210. See Signal-Handling Functions for more information
about the SIGABRT signal.
#include <stdlib.h> #include <string.h> #include <stdio.h> main() { char *passwd, reply[40]; passwd = "SAS"; puts("Passwd? "); gets(reply); if (strcmp(passwd,reply)){ puts("Password incorrect; execution terminating abnormally."); fclose(stdout); abort(); } puts("Password is correct."); }
abend
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.