Cách dùng hàm exit(int x) trong C

GiaCatPhuc

Legend of Zelda
Tham gia ngày
4/11/02
Bài viết
1,091
Reaction score
133
Ai biết cách dùng hàm này thì chỉ với :( mò hoài không ra.
Cám ơn nhé !
 
#include <stdlib.h>
void exit(int status);

Description

Terminates program.
exit terminates the calling process. Before termination, all files are closed, buffered output (waiting to be output) is written, and any registered "exit functions" (posted with atexit) are called.
status is provided for the calling process as the exit status of the process. Typically a value of 0 is used to indicate a normal exit, and a nonzero value indicates some error. It can be, but is not required, to be set with one of the following:

EXIT_FAILURE Abnormal program termination; signal to operating system that program has terminated with an error
EXIT_SUCCESS Normal program termination

Return Value

None.

bạn chịu khó đọc và tra từ điển nhé :'>
 
:| thì ra còn khai báo include .
 
Back
Top