2024年5月1日发(作者:)

函数名: abort

功 能: 异常终止一个进程

用 法: void abort(void);

程序例:

#include

#include

int main(void)

{

printf("Calling abort()n");

abort();

return 0; /* This is never reached */

}

函数名: abs

功 能: 求整数的绝对值

用 法: int abs(int i);

程序例:

#include

#include

int main(void)

{

int number = -1234;

printf("number: %d absolute value: %dn", number, abs(number));

return 0;

}

函数名: access

功 能: 确定文件的访问权限

用 法: int access(const char *filename, int amode);

程序例:

#include

#include

int file_exists(char *filename);

int main(void)

{

printf("Does exist: %sn",

file_exists("") ? "YES" : "NO");

return 0;

}

int file_exists(char *filename)

{

return (access(filename, 0) == 0);

}