C函数_fileno了解
来源:互联网 发布:高考状元辱骂同胞知乎 编辑:程序博客网 时间:2024/05/21 04:17
int _fileno(FILE *stream ); ----->Gets the file descriptor associated with a stream.(用来取得参数stream指定的文件流所使用的文件描述符)
#include<stdio.h>
返回值:某个数据流的文件句柄
DEMO:MSDN上的例子
#include <stdio.h>#include <process.h>int main(){printf("The file descriptor for stdin is %d\n",_fileno(stdin));printf("The file descriptor for stdout is %d\n",_fileno(stdout));printf("The file descriptor for stderr is %d\n",_fileno(stderr));system("pause");return 0;}
DEMO2:
#include <stdio.h>#include <process.h>int main(){FILE *fp=NULL;int file_handle;fp=fopen("fileno.c","r");if (fp==NULL){fprintf(stderr,"it's a error!\n");getchar();return -1;} file_handle=_fileno(fp);printf("fd=%d\n",file_handle);fclose(fp);fp=NULL;system("pause");return 0;}
【FROM MSDN &&百科】
- C函数_fileno了解
- C函数_filelength函数了解
- C语言scanf函数了解
- C语言sscanf函数了解
- C语言fscanf函数了解
- C语言gets函数了解
- C语言fgets函数了解
- C语言fopen函数了解
- C语言fclose函数了解
- C语言fwrite函数了解
- C语言fread函数了解
- C语言fseek函数了解
- C语言ftell函数了解
- C语言fgets函数了解
- C语言fscanf函数了解
- C语言fwrite函数了解
- C语言fread函数了解
- C语言fopen函数了解
- 听专家讲玛雅文明和“世界末日”
- jira 4.2 安装 (含破解及添加GreenHopper安装及破解)【转】
- Win32API不规则窗口制作
- 解决“在eclipse中配置Tomcat时,出现Cannot create a server using the selected type的错误”的问题
- openCV无法解析的外部符号-CvSVM、HOGDescriptor
- C函数_fileno了解
- 根据圆心、半径、起始角度终止角度求弧中点
- DNS原理及其解析过程【精彩剖析】
- MAXTNT,一个古老的传说
- 可重入函数与不可重入函数
- C++共享内存类
- 一个老问题VS2008程序发布问题
- 音视频基础知识学习
- window.showModalDialog以及window.open用法简介