网站首页 美容小常识 享受生活 东方时尚 识真假 高奢 资讯 游戏攻略 搞笑段子
当前位置:品位站 > 享受生活 > 心理

可以作为函数名的是|c语言中

栏目: 心理 / 发布于: / 人气:1.12W
c语言中 可以作为函数名的是

函数名: 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

}

函数名: absread, abswirte

功 能: 绝对磁盘扇区读、写数据

用 法: int absread(int drive, int nsects, int sectno, void *buffer) int abswrite(int drive, int nsects, in tsectno, void *buffer)

程序例:

/* absread example */

#include

#include

#include

#include

int main(void)

{ int i, strt, ch_out, sector

char buf[512]

printf("Insert a diskette into drive A and press any keyn") getch()

sector = 0

if (absread(0, 1, sector, &buf) != 0)

{ perror("Disk problem")

exit(1)

}

printf("Read OKn")

strt = 3

for (i=0 i<80 i++)

{ ch_out = buf[strt+i]

putchar(ch_out)

}

printf("n")

return(0)

}

函数名: access

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

用 法:

c语言中,可以作为函数名的是

函数名 就是函数的名字,只要符合命名规范的名字都可以作为函数名例如int fun()

{}那么这个函数的名字就是 funint fun2()

{}那么这个函数的名字就是 fun2

c语言中,可以作为函数名的是

关键字是由C语言规定的具有特定意义的字符串,通常也称为保留字。用户定义的任何标识符不应与关键字相同。当然是不可以作为函数名的。

Tags:语言 函数