请输入您要查询的百科知识:

 

词条 setmode
释义

函数名: setmode

功 能: 设置打开文件方式

用 法: int setmode(int handle, unsigned mode);

程序例:

#include <stdio.h>

#include <fcntl.h>

#include <io.h>

int main(void)

{

FILE *fp;

int result;

int fd;

fp = fopen(".\\\\OUTPUT.txt", "r");

result = setmode(fileno(fp), O_TEXT);

if (result == -1)

perror("Mode not available\");

else

printf("Mode successfully switched\");

fclose(fp);

}

//VC 6.0 下面编译执行通过

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/4/15 19:03:24