?? wbin.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 + -