⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wbin.c

📁 linux下的C语言开发
💻 C
字号:
/*-*//******************************************************** * Question:						* *	The routine fputc can be used to		* *	write out a single byte of a binary		* *	file.  The following program writes out		* *	numbers 0 to 127 to a file called		* *	test.out.  It works just fine on		* *	UNIX, creating a 128-byte long file;		* *	however, on DOS, the file contains 129		* *	bytes.  Why?					* ********************************************************//*+*/#include <stdio.h>#include <stdlib.h>	#ifndef __MSDOS__#include <unistd.h>#endif __MSDOS__int main(){    int cur_char;   /* current character to write */    FILE *out_file; /* output file */    out_file = fopen("test.out", "w");    if (out_file == NULL) {        fprintf(stderr,"Can not open output file\n");        exit (8);    }    for (cur_char = 0; cur_char < 128; ++cur_char) {        fputc(cur_char, out_file);    }    fclose(out_file);    return (0);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -