C

Size: px
Start display at page:

Download "C"

Transcription

1 C

2 /101 C

3 1.

4 ( ) 4/101 C

5 C ASCII ASCII ASCII 5/101 C

6 ASCII H 30H 30H 30H 30H ASCII 6/101 C

7 7/101 C

8 ( ) ( ) 8/101 C

9 UNIX ANSI C 9/101 C

10 FILE 10/101 C

11 stdio.h typedef struct { int level; // unsigned flags; // char fd; // unsigned char hold; // int bsize; // unsigned char * buffer;// unsigned char * curp; // unsigned istemp; // short token; // } FILE; 11/101 C

12 FILE * FILE * fp; 12/101 C

13 2.

14 ANSI C fopen() 14/101 C

15 fopen() FILE * fopen(const char * path,const char * mode); path mode 15/101 C

16 FILE * fp; fp = fopen("file1", "r"); file1 file1 NULL 16/101 C

17 : "r" "w" "a" "rb" "wb" "ab" 17/101 C

18 (fopen) : "r+" / "w+" / "a+" / "rb+" / "wb+" / "ab+" / 18/101 C

19 "r" "r" "w" 19/101 C

20 "a" "r+" "w+" "a+" 20/101 C

21 fopen() "r" "r" "rb" "r+" "rb+" NULL FILE * fp; if ( (fp=fopen("file1", "r")) ==NULL ) { printf("cannot open this file\n"); exit(0); } 21/101 C

22 22/101 C

23 (fclose) 23/101 C

24 fclose() int fclose( FILE * fp ); fclose() 0 EOF(-1) 24/101 C

25 25/101 C

26 I 1 /* count.c -- using standard I/O */ 2 #include <stdio.h> 3 #include <stdlib.h> // ANSI C exit() prototype 4 5 int main(int argc, char *argv[]) 6 { 7 int ch; 8 // place to store each character as read 9 FILE *fp; 10 // "file pointer" 11 long count = 0; if (argc!= 2) { 26/101 C

27 II 14 printf("usage: %s filename\n", argv[0]); 15 exit(1); 16 } if ((fp = fopen(argv[1], "r")) == NULL) { 19 printf("can t open %s\n", argv[1]); 20 exit(1); 21 } while ((ch = getc(fp))!= EOF) { 24 putc(ch,stdout); // same as putchar(ch); 25 count++; 26 } 27 fclose(fp); 27/101 C

28 III 28 printf("file %s has %ld characters\n", argv[1], count); return 0; 31 } 28/101 C

29 3.

30 fputc() fgetc() fprintf() fscanf() fread() fwrite() 30/101 C

31 fputc() fputc() int fputc(int c, FILE * stream); fputc() c unsigned char stream c ASCII EOF 31/101 C

32 fgetc() fgetc() int fgetc(file * stream); fgetc() stream EOF. EOF feof(fp) feof(fp)==1 32/101 C

33 fgetc() 33/101 C

34 fgetc() I 1 // file2screen.c: 2 #include<stdio.h> 3 #include<stdlib.h> 4 5 int main(int argc, char * argv[]) 6 { 7 FILE * fp; 8 int ch; 9 10 if (argc!= 2) { 11 printf("usage: %s filename\n", argv[0]); 12 exit(1); 13 } 34/101 C

35 fgetc() II if ((fp = fopen(argv[1], "r")) == NULL) { 16 printf("can t open %s\n", argv[1]); 17 exit(1); 18 } while ((ch = fgetc(fp))!= EOF) { 21 putchar(ch); // same as putchar(ch); 22 } return 0; 25 } 35/101 C

36 fgetc() while(!feof(fp)) { ch = fgetc(fp);... } 36/101 C

37 fputc() fgetc() # 37/101 C

38 fputc() fgetc() I 1 // screen2file.c: 2 #include <stdio.h> 3 #include <stdlib.h> 4 int main(void) 5 { 6 char ch; 7 FILE *fp; 8 9 if ( (fp = fopen("file1.txt", "w")) == NULL) { 10 printf("cannot open file1.txt!\n"); 11 exit(1); 12 } 13 while ((ch = getchar())!= # ) 38/101 C

39 fputc() fgetc() II 14 fputc(ch, fp); 15 fclose(fp); return 0; 18 } 39/101 C

40 fputc() fgetc() 40/101 C

41 fputc() fgetc() I 1 // copy.c: 2 #include <stdio.h> 3 #include <stdlib.h> 4 int main(int argc, char * argv[]) 5 { 6 char ch; 7 FILE * fsrc, * fdes; 8 9 if (argc < 3) { 10 printf("usage: %s srcfile desfile\n", argv[0]); 11 exit(1); 12 } 13 41/101 C

42 fputc() fgetc() II if ((fsrc = fopen(argv[1], "r")) == NULL 16 (fdes = fopen(argv[2], "w")) == NULL) { 17 printf("cannot open files!\n"); 18 exit(1); 19 } while ((ch = getc(fsrc))!= EOF) 22 fputc(ch, fdes); 23 printf("successed copy srcfile to desfile\n"); fclose(fsrc); 26 fclose(fdes); 27 42/101 C

43 fputc() fgetc() III 28 return 0; 29 } 43/101 C

44 fscanf() fprintf() fprintf() fscanf() printf() scanf() fprintf() fscanf() printf() scanf() 44/101 C

45 fscanf() fprintf() int fprintf(file * stream, const char *format,...); int fscanf (FILE * stream, const char *format,...); printf()/scanf() 45/101 C

46 fscanf() fprintf() fprintf(fp, "%d, %6.2f", i, t); i t %d %6.2f fp i=3, t=4.5 3, /101 C

47 fscanf() fprintf() fscanf() ASCII fscanf(fp, "%d, %f", &i, &t); 3, i 4.5 t 47/101 C

48 fscanf() fprintf() 48/101 C

49 fscanf() fprintf() I 1 #include <stdio.h> 2 #include <stdlib.h> 3 #define MAX 40 4 int main(void) 5 { 6 FILE *fp; 7 char words[max]; 8 9 if((fp = fopen("words", "a+")) == NULL) { 10 fprintf(stdout, "Can t open \"words\" file.\n"); 11 exit(1); 12 } 13 49/101 C

50 fscanf() fprintf() II 14 puts("enter words to add to the file: press the Enter "); 15 puts("key at the beginning of a line to terminate." ); 16 while ( gets(words)!= NULL && words[0]!= \0 ) 17 fprintf(fp, "%s", words); 18 puts("file contents:"); 19 rewind(fp); 20 while(fscanf(fp, "%s", words)==1) 21 puts(words); 22 fclose(fp); return 0; 25 } 50/101 C

51 fscanf() fprintf() III 51/101 C

52 fscanf() fprintf() fprintf() fscanf() ASCII fprintf() fscanf() fread() fwrite() 52/101 C

53 putw() getw() putw() getw() ( ) putw(10, fp); /* 10 fp */ i = getw(fp); /* fp i */ 53/101 C

54 fgets() fputs() fgets() fgets(str, n, fp); // fp n-1 str // str \0 fputs() fputs(str, fp); // str fp 54/101 C

55 fread() fwrite() num double num = 1./3.; fprintf(fp,"%f", num); % %.12f /101 C

56 fread() fwrite() num 0.33 fprintf() 56/101 C

57 fread() fwrite() double double fread() fwrite() 57/101 C

58 fread() fwrite() fwrite() size_t fwrite(const void * ptr, size_t size, size_t nmemb, FILE * fp); ptr size nmemb fp nmemb nmemb 58/101 C

59 fread() fwrite() 256 char buffer[256]; fwrite(buffer, 256, 1, fp) /101 C

60 fread() fwrite() 10 double double arr[10]; fwrite(arr, sizeof(double), 10, fp) arr 10 double 60/101 C

61 fread() fwrite() fread() size_t fread(const void * ptr, size_t size, size_t nmemb, FILE * fp); ptr size nmemb fp nmemb nmemb 61/101 C

62 fread() fwrite() 10 double double arr[10]; fread(arr, sizeof(double), 10, fp) 10 double arr 62/101 C

63 fread() fwrite() struct student_type { char name[10]; int num; int age; char addr[30]; } stu[40]; stu 40 63/101 C

64 fread() fwrite() for fread() 40 for(i=0; i<40; i++) fread(&stu[i], sizeof(struct student_type), 1, fp); fread(stu, sizeof(struct student_type), 40, fp); 64/101 C

65 fread() fwrite() for(i=0; i<40; i++) fwrite(&stu[i], sizeof(struct student_type), 1, fp); fwrite(stu, sizeof(struct student_type), 40, fp); 65/101 C

66 fread() fwrite() 66/101 C

67 fread() fwrite() I 1 #include <stdio.h> 2 #include <stdlib.h> 3 #define SIZE 4 4 void save(void); 5 6 struct stu_type 7 { 8 char name[20]; 9 int num; 10 int age; 11 char addr[15]; 12 } stu[size]; 13 67/101 C

68 fread() fwrite() II 14 int main(void) 15 { 16 int i; 17 FILE * fp; 18 printf("sizeof(structstud)=%d\n", (int) sizeof( struct stu_type)); 19 printf("please input the 4 student information, " 20 "including name, num, age, address\n"); 21 for(i = 0; i < SIZE; i++) 22 scanf("%s%d%d%s", stu[i].name, &stu[i].num, 23 &stu[i].age, stu[i].addr); 24 save(); 25 printf("\nthe information of the 4 students is:\n") ; 68/101 C

69 fread() fwrite() III 26 fp = fopen("stu_list.txt","rb"); fread(stu, sizeof(struct stu_type), SIZE, fp); 29 for(i = 0; i < SIZE; i++) 30 { 31 // fread(&stu[i], sizeof(struct stu_type), 1, fp); 32 printf("%-10s%4d%4d%15s\n", stu[i].name, stu[i]. num, 33 stu[i].age, stu[i].addr); 34 } 35 fclose(fp); return 0; 38 } 69/101 C

70 fread() fwrite() IV void save(void) 41 { 42 FILE * fp; 43 int i; if ((fp = fopen("stu_list.txt", "wb")) == NULL) { 46 printf("cannot open file!\n"); 47 exit(1); 48 } 49 for (i = 0; i < SIZE; i++) { 50 if (fwrite(&stu[i], sizeof(struct stu_type), 1, fp)!= 1) 51 printf("file write error.\n"); 70/101 C

71 fread() fwrite() V 52 } 53 fclose(fp); } 71/101 C

72 fread() fwrite() 72/101 C

73 fread() fwrite() I 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main(void) 4 { 5 float buffer[] = {1.0, 2.0, 3.0}; 6 float read[3]; 7 FILE * fp; 8 9 if ((fp = fopen("file3.txt", "wb")) == NULL) { 10 printf("cannot open files.\n"); 11 exit(0); 12 } 13 fwrite(buffer, 1, sizeof(buffer), fp); 73/101 C

74 fread() fwrite() II 14 fclose(fp); if ((fp = fopen("file3.txt", "rb")) == NULL) { 17 printf("cannot open files.\n"); 18 exit(0); 19 } 20 fread(read, 1, sizeof(read), fp); 21 printf("%f %f %f\n", read[0], read[1], read[2]); 22 fclose(fp); return 0; 25 } 74/101 C

75 4.

76 ftell() rewind()/fseek() 76/101 C

77 rewind() void rewind(file * stream); fp 77/101 C

78 rewind() 78/101 C

79 rewind() I 1 // rewind.c: 2 #include <stdio.h> 3 #include <stdlib.h> 4 int main(int argc, char * argv[]) 5 { 6 int ch; 7 FILE * fsrc, * fdes; 8 9 if (argc < 3) { 10 printf("usage: %s srcfile desfile\n", argv[0]); 11 exit(1); 12 } 13 79/101 C

80 rewind() II 14 if ((fsrc = fopen(argv[1], "r")) == NULL 15 (fdes = fopen(argv[2], "w")) == NULL) { 16 printf("cannot open files!\n"); 17 exit(1); 18 } 19 while ((ch = getc(fsrc))!= EOF) 20 putchar(ch); rewind(fsrc); 23 while ((ch = getc(fsrc))!= EOF) 24 fputc(ch, fdes); fclose(fsrc); 27 fclose(fdes); 80/101 C

81 rewind() III return 0; 30 } 81/101 C

82 rewind() file.txt C primer plus C programming $ gcc rewind.c -o rewind $./rewind file.txt file1.txt C primer plus C programming 82/101 C

83 fseek() fseek() int fseek(file * stream, long offset, int fromwhere); fseek() /101 C

84 fseek() SEEK_SET 0 SEEK_CUR 1 SEEK_END 2 84/101 C

85 fseek() fseek(fp, 0L, SEEK_SET); // fseek(fp, 10L, SEEK_SET); // 10 fseek(fp, 2L, SEEK_CUR); // //2 fseek(fp, 0L, SEEK_END); // fseek(fp, -10L, SEEK_END);// 10 85/101 C

86 ftell() ftell() ANSI C i = ftell(fp); if(i == -1L) printf("error\n"); i ( fp ) "error" 86/101 C

87 fseek() ftell() 87/101 C

88 fseek() ftell() I 1 // reverse.c 2 #include<stdio.h> 3 #include<stdlib.h> 4 #define CNTL_Z \032 5 #define SLEN 50 6 int main(void) 7 { 8 char file[slen]; 9 char ch; 10 FILE * fp; 11 long count, last; 12 88/101 C

89 fseek() ftell() II 13 puts("enter the name of the file to be processed: " ); 14 gets(file); if ((fp = fopen(file, "rb"))==null) { 17 printf("reverse can t be open %s\n", file); 18 exit(1); 19 } fseek(fp, 0L, SEEK_END); 22 last = ftell(fp); for (count = 1L; count <= last; count++) { 25 fseek(fp, -count, SEEK_END); 89/101 C

90 fseek() ftell() III 26 ch = getc(fp); 27 if (ch!= CNTL_Z && ch!= \r ) 28 putchar(ch); 29 } putchar( \n ); 32 fclose(fp); return 0; 35 } 90/101 C

91 fseek() ftell() // file4 Hello World! I love WHU! Enter the name of the file to be processed: file4!uhw evol I!dlroW olleh 91/101 C

92 fseek() ftell() double 92/101 C

93 fseek() ftell() I 1 // randbin.c 2 #include <stdio.h> 3 #include <stdlib.h> 4 #define SIZE int main(void) 7 { 8 double arr[size]; 9 double value; 10 const char * file = "number.dat"; 11 int i; 12 long pos; 13 FILE * fp; 93/101 C

94 fseek() ftell() II // Creat an array with double elements 16 for (i = 0; i < SIZE; i++) 17 arr[i] = * i / (i + 1); // Attempt to open file 20 if ((fp = fopen(file, "wb")) == NULL) { 21 fprintf(stderr, "Could not open %s for output", file); 22 exit(1); 23 } // Write the data in the array into file with binary mode 94/101 C

95 fseek() ftell() III 26 fwrite(arr, sizeof(double), SIZE, fp); // Close the file 29 fclose(fp); // Attempt to open file 32 if ((fp = fopen(file, "rb")) == NULL) { 33 fprintf(stderr, "Could not open %s for random acess", file); 34 exit(1); 35 } // Read selected item in the file 95/101 C

96 fseek() ftell() IV 38 printf("enter an index in the range 0-%d\n", SIZE -1); 39 scanf("%d", &i); while(i >= 0 && i < SIZE) { 42 pos = (long) i * sizeof(double); // compute offset 43 fseek(fp, pos, SEEK_SET); 44 fread(&value, sizeof(double), 1, fp); 45 printf("the value there is %f.\n", value); 46 printf("next index (out of range to quit):\n"); 47 scanf("%d", &i); 48 } 49 fclose(fp); 96/101 C

97 fseek() ftell() V 50 puts("bye!"); return 0; 53 } 97/101 C

98 fseek() ftell() I Enter an index in the range The value there is Next index (out of range to quit): 4 The value there is Next index (out of range to quit): 5 The value there is Next index (out of range to quit): 100 The value there is Next index (out of range to quit): 98/101 C

99 fseek() ftell() II -1 Bye! 99/101 C

100 5.

101 C 101/101 C

102 ferror() fopen() NULL ferror() int ferror(file * stream); /101 C

103 cleanerr int ferror(file * stream); 0 ferror(fp) 0 clearerr(fp) ferror(fp) 0 103/101 C

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

プログラムの設計と実現II

プログラムの設計と実現II UNIX C ls mkdir man http://www.tj.chiba-u.jp/lecture/prog2/ Ctrl+x, Ctrl+s ( )..[4]% gcc Wall o hoge hoge.c..[5]%./hoge 1 : 1 2 : 2 3 : 3 4 : 0 6..[6]% (! )..[4]% gcc Wall o hoge hoge.c..[5]%!g gcc Wall

More information

epub 33-8

epub 33-8 8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE

More information

新版 明解C言語入門編

新版 明解C言語入門編 328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66

More information

新・明解C言語入門編『索引』

新・明解C言語入門編『索引』 !... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177

More information

新・解きながら学ぶC言語

新・解きながら学ぶC言語 330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180

More information

C

C C 2017 3 14 1. 2. 3. 4. 2/95 C 1. 3/95 C I 1 // talkback.c: 2 #include 3 #include 4 #define DENSITY 62.4 5 int main(void) 6 { 7 float weight, volume; 8 int size; 9 unsigned long letters;

More information

_汪_文前新ok[3.1].doc

_汪_文前新ok[3.1].doc 普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向

More information

C/C++ - 函数

C/C++ - 函数 C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

实际问题 : 1 职工信息管理系统 2 学生选课系统 3 飞机订票系统 4 图书信息管理系统 5 图象处理

实际问题 : 1 职工信息管理系统 2 学生选课系统 3 飞机订票系统 4 图书信息管理系统 5 图象处理 实际问题 : 1 职工信息管理系统 2 学生选课系统 3 飞机订票系统 4 图书信息管理系统 5 图象处理 10.1 C 文件概述 文件 : 存储在外部介质上数据的集合, 是操作系统数据管理的单位使用数据文件的目的 文件分类 1 数据文件的改动不引起程序的改动 程序与数据分离 2 不同程序可以访问同一数据文件中的数据按文件的逻辑结构 : 数据共享 3 能长期保存程序运行的中间数据或结果数据 记录文件

More information

C/C++ - 字符串与字符串函数

C/C++ - 字符串与字符串函数 C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

C/C++程序设计 - 字符串与格式化输入/输出

C/C++程序设计 - 字符串与格式化输入/输出 C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int

More information

C C

C C C C 2017 3 8 1. 2. 3. 4. char 5. 2/101 C 1. 3/101 C C = 5 (F 32). 9 F C 4/101 C 1 // fal2cel.c: Convert Fah temperature to Cel temperature 2 #include 3 int main(void) 4 { 5 float fah, cel; 6 printf("please

More information

文件

文件 CH10 文件 1 文件的概念 一 文件分类 二 文件的组织结构 : ASCII 码文件 ( 文本文件 ) 二进制文件 文件是二进制代码的, 则文件就是字节流 文件是 ASCII 码的, 则文件就是字符流, 也是字节流 1 如 : 对于整型变量 x, 其值为 32767 若以文本方式存放, 则共有 5 个字符, 内容为 : 00110011 00110010 00110111 00110110 00110111

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

nooog

nooog C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1

More information

第7章 数组

第7章  数组 第 12 章文件 内容 自定义类型 (typedef) 文件是什么?C 语言如何处理文件? 文本文件和二进制文件 打开 关闭文件 文件读写程序 其它相关函数 2 内容 自定义类型 (typedef) 文件是什么?C 语言如何处理文件? 文本文件和二进制文件 打开 关闭文件 文件读写程序 其它相关函数 3 自定义类型 (typedef) 自定义类型 (typedef) typedef < 已有类型名

More information

chap12.ppt

chap12.ppt 第十二章 文件 C ( 前所讲 ) 程序 ( 可包含若干源程序文件 ) 文件 也属于. 目的 : 使程序操作中的数据得以长期保存 一 概述 OS 以文件为单位对数据进行存储管理 流与文件流 :C 提供的一个 I/O 统一接口, 与具体的被访问设备无关 把 I/O 工作抽象成从源到目地的流, 所有的 I/O 通过流来进行, 所有流都具有相同的行为 文件 : 指具体的实际设备 ( 一切具有 I/O 能力的外部设备

More information

untitled

untitled Introduction to Programming ( 數 ) Lecture 3 Spring 2005 March 4, 2005 Lecture 2 Outline 數 料 If if 狀 if 2 (Standard Output, stdout): 料. ((Standard Input, stdin): 料. 類 數 數 數 說 printf 見 數 puts 串 數 putchar

More information

附錄C.doc

附錄C.doc C C C-1 C -2 C -3 C -4 C -5 / C -6 2 C/C++ C-1 FILE* fopen(const char* filename, const char* mode) filename NULL FILE* freopen(const

More information

C

C C 2017 4 1 1. 2. while 3. 4. 5. for 6. 2/161 C 7. 8. (do while) 9. 10. (nested loop) 11. 12. 3/161 C 1. I 1 // summing.c: 2 #include 3 int main(void) 4 { 5 long num; 6 long sum = 0L; 7 int status;

More information

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023) ( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.

More information

Microsoft Word - chap13.doc

Microsoft Word - chap13.doc ï FILE dã Ä o rô qî ô Ö ƒù å o ô ÃÓ FILE Ã Ù Ö o v-> ª w ï FILE d wã +1 ~ c:\temp w Õx test.dat Ã Û vä à n ïw à test.dat 13-2a /* File name: ex13-2a.c */ #include char ch; fptr = fopen("c:\\temp\\test.dat",

More information

Microsoft PowerPoint - C-Ch12.ppt

Microsoft PowerPoint - C-Ch12.ppt 檔案的輸入 輸出 12-1 輸入 輸出的基礎 理解資料流 (stream) 的概念 在 C 語言中支援各種輸出入功能的概念, 就稱為資料流 執行附加格式的輸入 輸出 printf() 和 scanf() 是用來輸出 輸入的函數 必須先引入 stdio.h 檔案才能使用這些函數 這兩個函數會以固定的格式進行輸出入, 也可以使用各種不同的轉換規格 使用固定格式的輸出 輸入函數之範例 : int main(void)

More information

1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7

1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7 1 2005 9 2005,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : 100081 : : 7871092 1 /16 : 8. 75 : 96 : 2005 11 1 : 2005 11 1 : ISBN 7-80097 - 564-9 /TP 8 : 10. 00 ,,,, 1994 NCRE,,, ( ),,,,,

More information

C/C++ - 数组与指针

C/C++ - 数组与指针 C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 float candy [ 365]; char code [12]; int states [50]; 2 int array [6] = {1, 2, 4, 6, 8, 10}; 3 // day_mon1.c: # include # define MONTHS 12 int

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

More information

untitled

untitled 1 DBF (READDBF.C)... 1 2 (filetest.c)...2 3 (mousetes.c)...3 4 (painttes.c)...5 5 (dirtest.c)...9 6 (list.c)...9 1 dbf (readdbf.c) /* dbf */ #include int rf,k,reclen,addr,*p1; long brec,erec,i,j,recnum,*p2;

More information

C/C++语言 - 运算符、表达式和语句

C/C++语言 - 运算符、表达式和语句 C/C++ Table of contents 1. 2. 3. 4. C C++ 5. 6. 7. 1 i // shoe1.c: # include # define ADJUST 7. 64 # define SCALE 0. 325 int main ( void ) { double shoe, foot ; shoe = 9. 0; foot = SCALE * shoe

More information

untitled

untitled 不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int

More information

C/C++语言 - 分支结构

C/C++语言 - 分支结构 C/C++ Table of contents 1. if 2. if else 3. 4. 5. 6. continue break 7. switch 1 if if i // colddays.c: # include int main ( void ) { const int FREEZING = 0; float temperature ; int cold_ days

More information

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc 2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.

More information

Ps22Pdf

Ps22Pdf ( 98 ) C ( ) ( )158 1998 C : C C C,,, C,, : C ( ) : : (, 100084) : : : 7871092 1/ 16 :18 25 :415 : 2000 3 1 2000 3 1 : ISBN 7 302 01166 4/ T P432 : 00016000 : 22 00 ( 98 ) 20 90,,, ;,,, 1994, 1998, 160,

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information

PowerPoint 演示文稿

PowerPoint 演示文稿 第 13 章外存中数据的组织 文件 本章的基本内容是 : 概述 文件的打开与关闭 文件的读写操作 任务 13.1 统计入学成绩 ( 文件版 ) 问题 某大学的博士入学考试科目为外语和两门专业课, 对于每个考生, 输入各科考试成绩并计算总分 要求用文件实现 想法 已经录入的成绩信息应该用文件保存下来, 已经计算的总分也应该保存到文件中, 并已追加方式继续录入 算法 文件 student.txt 存放学生的成绩信息,

More information

Microsoft Word - CPE考生使用手冊160524.docx

Microsoft Word - CPE考生使用手冊160524.docx 大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該

More information

[改訂新版]C言語による標準アルゴリズム事典

[改訂新版]C言語による標準アルゴリズム事典 iii C 1991 SEND + MORE = MONEY C 100 2003 Java 2003 27 PC-9800 C BMP SVG EPS BMPSVG WindowsMacLinux Web iv int main() int main(void) EXIT_SUCCESS 0 https://github.com/okumuralab/ algo-c TEX TEX PDF PDF

More information

C, Win-TC Turbo C,, C, C,,,, C C, : Win-TC C, 23,,, 15,, C Turbo C Win-TC Turbo C,,,, 2005 1 W in -TC 1 Win-TC 1 1. Win-TC 1 2. Win-TC 1 3. Win-TC 1 2 Win-TC 3 1. 3 2. 3 3. 4 4. 4 5. 4 6. 4 7. 5 8. 5 9.

More information

untitled

untitled 串 串 例 : char ch= a ; char str[]= Hello ; 串 列 ch=getchar(); scanf( %c,&ch); 串 gets(str) scanf( %s,str); 8-1 數 ASCII 例 : char ch= A ; printf( %d,ch); // 65 A ascii =0x41 printf( %c,ch); // A 例 : char ch;

More information

IO

IO 1 C/C++ C FILE* fscanf fgets fread fprintf fputs fwrite C++ ifstream ofstream >>

More information

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf (%d, & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf (%d %d 2013 18 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp, Compilation Error cin scanf Time Limit Exceeded 1: A 5 B 5 C 5 D 5 E 5 F 5 1 2013 C 1 # include 2 int main ( void ) 3 { 4 int cases, a, b,

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 177 [P179] (1) - [P181] [P182] (2) - for [P183] (3) - switch [P184] [P187] [P189] [P194] 178 [ ]; : : int var; : int var[3]; var 2293620 var[0] var[1] 2293620

More information

Ps22Pdf

Ps22Pdf C ( CIP) C /. :, 2001. 7 21 ISBN 7-5624 -2355-5. C........ C. TP312 CIP ( 2001 ) 034496 C * * : 7871092 1 /16 : 14. 25 : 356 20017 1 20017 1 : 1 6 000 ISBN 7-5624-2355-5 / TP311 : 21. 00 C, C,,,, C,, (

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++

More information

Microsoft PowerPoint - 20-string-s.pptx

Microsoft PowerPoint - 20-string-s.pptx String 1 String/ 1.: char s1[10]; char *s2; char s3[] = "Chan Tai Man"; char s4[20] = "Chan Siu Ming"; char s5[]={'h','e','l','l','o','\0'; 0 1 2 3 4 5 6 7 8 9 10 11 12 s3 C h a n T a i \0 M a n \0 printf

More information

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,

More information

Microsoft Word - 考试大纲-2015-56(2)

Microsoft Word - 考试大纲-2015-56(2) 考 试 大 纲 2015 版 首 都 师 范 大 学 信 息 工 程 学 院 目 录 C 语 言 程 序 设 计 考 试 大 纲... 1 DSP 原 理 与 应 用 考 试 大 纲... 7 DSP 原 理 与 应 用 实 验 考 试 大 纲... 9 SOPC 设 计 与 实 践 考 试 大 纲... 10 编 译 原 理 考 试 大 纲... 15 操 作 系 统 考 试 大 纲... 23

More information

11. 下列关于文件的结论中正确的是 ( ) A. 对文件操作必须先关闭文件 B. 对文件操作必须先打开文件 C. 对文件的操作顺序没有统一规定 D. 以上三种答案全是错误的 12. 若以 a+ 方式打开一个已存在的文件, 则以下叙述正确的是 ( ) A. 文件打开时, 原有文件内容不被删除, 位置

11. 下列关于文件的结论中正确的是 ( ) A. 对文件操作必须先关闭文件 B. 对文件操作必须先打开文件 C. 对文件的操作顺序没有统一规定 D. 以上三种答案全是错误的 12. 若以 a+ 方式打开一个已存在的文件, 则以下叙述正确的是 ( ) A. 文件打开时, 原有文件内容不被删除, 位置 单元 5 构造类型程序设计 文件 同步训练 一 单项选择题 1. 系统的标准输入文件是指 ( ) A. 键盘 B. 显示器 C.U 盘 D. 硬盘 2. 在进行文件操作时, 写文件的一般含义是 ( ) A. 将计算机内存在的信息存入磁盘 B. 将磁盘中的信息存入计算机内存 C. 将计算机 CPU 中的信息存入磁盘 D. 将磁盘中的信息存入计算机 CPU 3. 系统的标准输出文件是指 ( ) A. 键盘

More information

<4D F736F F D20B5DA31D5C220C7B6C8EBCABDD3A6D3C3B3CCD0F2C9E8BCC6D7DBBACFBDCCB3CC2E646F63>

<4D F736F F D20B5DA31D5C220C7B6C8EBCABDD3A6D3C3B3CCD0F2C9E8BCC6D7DBBACFBDCCB3CC2E646F63> 嵌入式应用程序设计综合教程作者 : 华清远见 第 1 章 Linux 标准 I/O 编程 本章目标 在应用开发中经常要访问文件 Linux 下读写文件的方式有两大类 : 标准 I/O 和文件 I/O 其中标准 I/O 是最常用也是最基本的内容, 希望读者好好掌握 本章主要内容 : Linux 系统调用和用户编程接口 (API); Linux 标准 I/O 概述 ; 标准 I/O 操作 1.1 Linux

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

C/C++ - 结构体、共用体、枚举体

C/C++ - 结构体、共用体、枚举体 C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 C C (struct) C 2 C C (struct) C 2 i // book.c: # include < stdio.h> # define MAX_ TITLE 41 # define MAX_ AUTHOR 31 struct book { char title [ MAX_ TITLE

More information

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf (%d, & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9 201 201 21 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 1 B 1 C 5 D RPG 10 E 10 F 1 G II 1 1 201 201 C 1 # include 2 int main ( void

More information

第3章 类型、运算符与表达式

第3章 类型、运算符与表达式 Files C Programming Language Li Hanjing I/O 设备 输入设备 键盘 鼠标 软盘 硬盘 光驱 ( 以文件的形式 ) 串行口 并行口 USB 接口 IEEE1394 口 网络端口 扫描仪 视频采集卡 电视卡 游戏杆 话筒 输出设备 显示器 打印机 软盘 硬盘 CD-RW/DVD-RW( 以文件的形式 ) 串行口 并行口 USB 接口 IEEE1394 口 网络端口

More information

华恒家庭网关方案

华恒家庭网关方案 LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU

More information

static struct file_operations gpio_ctl_fops={ ioctl: gpio_ctl_ioctl, open : gpio_open, release: gpio_release, ; #defineled1_on() (GPBDAT &= ~0x1) #def

static struct file_operations gpio_ctl_fops={ ioctl: gpio_ctl_ioctl, open : gpio_open, release: gpio_release, ; #defineled1_on() (GPBDAT &= ~0x1) #def Kaise s 2410 Board setting [1]. Device Driver Device Driver Linux s Kernel ARM s kernel s3c2410_kernel2.4.18_r1.1_change.tar.bz2 /usr/src (1) #cd /usr/src (2) #tar xfj s3c2410_kernel2.4.18_r1.1_change.tar.bz2

More information

51 C 51 isp 10 C PCB C C C C KEIL

51 C 51 isp 10   C   PCB C C C C KEIL http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom

More information

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf(%d, &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf(% 2013 ( 28 ) ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 10 B 1 C 1 D 5 E 5 F 1 G II 5 H 30 1 2013 C 1 #include 2 int main(void) 3

More information

2015年计算机二级(C语言)模拟试题及答案(四)

2015年计算机二级(C语言)模拟试题及答案(四) 2016 年 计 算 机 二 级 (C 语 言 ) 模 拟 试 题 及 答 案 (4) 一 填 空 题 1 C 语 言 中 基 本 的 数 据 类 型 有 : 2 C 语 言 中 普 通 整 型 变 量 的 类 型 说 明 符 为, 在 内 存 中 占 字 节, 有 符 号 普 通 整 型 的 数 据 范 围 是 3 整 数 -35 在 机 内 的 补 码 表 示 为 4 执 行 下 列 语 句 int

More information

C/C++ Basics

C/C++ Basics 第 十章 檔案輸入與輸出 講師 : 李根逸 (Ken-Yi Lee), E-mail: feis.tw@gmail.com 265 課程 大綱 與作業系統或其他軟體溝通 (API) [P267] 檔案相關函式表 [P268] 開啟與關閉檔案 (fopen, fclose) 讀寫純 文字檔 (fscanf, fprintf) 讀寫 二進位檔 (fread, fwrite) 前置處理器

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

C/C++ Programming

C/C++ Programming !281 第 十講 檔案輸入與輸出 講師 : 李根逸 (Ken-Yi Lee), E-mail: feis.tw@gmail.com !282 課程 大綱 與作業系統或其他軟體溝通 (API) [P.283] 檔案相關函式表 [P.284] 開啟與關閉檔案 (fopen, fclose) 讀寫純 文字檔 (fscanf, fprintf) 讀寫 二進位檔 (fread, fwrite)

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

More information

1. SDK 概述 Arcsoft Photo Styling SDK 可以将输入图像转化为具有指定风格的图像 图像风格主要是指色调 笔触 线条等图像的特异性表现形式 存储某一艺术图像风格模板的文件将按需要发布给 SDK 使用者 借助 SDK 和风格模板文件, 用户可以开发图像风格化等图像美化类应用

1. SDK 概述 Arcsoft Photo Styling SDK 可以将输入图像转化为具有指定风格的图像 图像风格主要是指色调 笔触 线条等图像的特异性表现形式 存储某一艺术图像风格模板的文件将按需要发布给 SDK 使用者 借助 SDK 和风格模板文件, 用户可以开发图像风格化等图像美化类应用 Arcsoft Photo Styling SDK 开发文档 目录 Arcsoft Photo Styling SDK 开发文档... 1 1. SDK 概述... 2 2. SDK 运行环境及相关指标... 2 2.1 运行环境... 2 2.2 运行指标... 3 3. API 说明... 3 3.1 函数... 3 APS_FSDK_Get_Version... 3 APS_FSDK_InitEngine...

More information

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer

More information

1

1 1 2 3 4 5 GNUDebugger 6 7 void main(int argc, char **argv){ vulncpy(argv[1]); return; } void vulncpy(char *a){ char buf[30]; strcpy(buf, a); return; } *argv[1] buf Shellcode *argv[1]... &buf &buf 8 strcpy

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit 6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128

More information

Generated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3

Generated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3 浙江大学 C 程序设计及实验 试题卷 2002-2003 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:30-10:30 注意 : 答题内容必须写在答题卷上, 写在本试题卷上无效 一. 单项选择题 ( 每题 1 分, 共 10 分 ) 1. 下列运算符中, 优先级最低的是 A.

More information

第3章.doc

第3章.doc 3 3 3 3.1 3 IT Trend C++ Java SAP Advantech ERPCRM C++ C++ Synopsys C++ NEC C C++PHP C++Java C++Java VIA C++ 3COM C++ SPSS C++ Sybase C++LinuxUNIX Motorola C++ IBM C++Java Oracle Java HP C++ C++ Yahoo

More information

液晶之家论坛-

液晶之家论坛- 10 C Sep.22,1997 10 C [] 1997 6 3 page C Turbo C 2 C 4 10 13 21 32 40 46 55 1 C Turbo C C C / Turbo C Turbo C Turbo C PATH PATH=C:\TC;C:\DOS;... TC Turbo C PATH DOS TC Turbo C TC (Edit)(Compile)(Link)(Debug)

More information

上海市教育考试院关于印发新修订的

上海市教育考试院关于印发新修订的 沪 教 考 院 社 考 2012 7 号 上 海 市 教 育 考 试 院 关 于 印 发 上 海 市 高 等 学 校 计 算 机 等 级 考 试 大 纲 (2012 年 修 订 ) 的 通 知 各 有 关 高 校 : 为 进 一 步 加 强 本 市 高 校 计 算 机 基 础 教 学 工 作, 推 进 学 校 更 加 科 学 合 理 地 设 置 计 算 机 基 础 课 程 及 安 排 教 学 内 容,

More information

02

02 Thinking in C++: Volume One: Introduction to Standard C++, Second Edition & Volume Two: Practical Programming C++ C C++ C++ 3 3 C C class C++ C++ C++ C++ string vector 2.1 interpreter compiler 2.1.1 BASIC

More information

項 訴 求 在 考 慮 到 整 體 的 財 政 承 擔 以 及 資 源 分 配 的 公 平 性 下, 政 府 採 取 了 較 簡 單 直 接 的 一 次 性 減 稅 和 增 加 免 稅 額 方 式, 以 回 應 中 產 家 庭 的 不 同 訴 求 ( 三 ) 取 消 外 傭 徵 費 6. 行 政 長

項 訴 求 在 考 慮 到 整 體 的 財 政 承 擔 以 及 資 源 分 配 的 公 平 性 下, 政 府 採 取 了 較 簡 單 直 接 的 一 次 性 減 稅 和 增 加 免 稅 額 方 式, 以 回 應 中 產 家 庭 的 不 同 訴 求 ( 三 ) 取 消 外 傭 徵 費 6. 行 政 長 2013 年 1 月 23 日 的 立 法 會 會 議 葛 珮 帆 議 員 就 幫 助 中 產 動 議 的 議 案 ( 經 單 仲 偕 議 員 及 莫 乃 光 議 員 修 正 ) 進 度 報 告 在 2013 年 1 月 23 日 的 立 法 會 會 議 上, 由 葛 珮 帆 議 員 就 幫 助 中 產 動 議 的 議 案, 經 單 仲 偕 議 員 及 莫 乃 光 議 員 修 正 後 獲 得 通 過

More information

(f) (g) (h) (ii) (iii) (a) (b) (c) (d) 208

(f) (g) (h) (ii) (iii) (a) (b) (c) (d) 208 (a) (b) (c) (d) (e) 207 (f) (g) (h) (ii) (iii) (a) (b) (c) (d) 208 17.29 17.29 13.16A(1) 13.18 (a) (b) 13.16A (b) 12 (a) 209 13.19 (a) 13.16A 12 13.18(1) 13.18(4) 155 17.43(1) (4) (b) 13.19 17.43 17.29

More information

Microsoft Word - 08 单元一儿童文学理论

Microsoft Word - 08 单元一儿童文学理论 单 元 ( 一 ) 儿 童 文 学 理 论 内 容 提 要 : 本 单 元 共 分 成 三 个 小 课 目, 即 儿 童 文 学 的 基 本 理 论 儿 童 文 学 创 作 和 儿 童 文 学 的 鉴 赏 与 阅 读 指 导 儿 童 文 学 的 基 本 理 论 内 容 包 括 儿 童 文 学 的 基 本 含 义 儿 童 文 学 读 者 儿 童 文 学 与 儿 童 年 龄 特 征 和 儿 童 文 学

More information

untitled

untitled 1993 79 2010 9 80 180,000 (a) (b) 81 20031,230 2009 10,610 43 2003 2009 1,200 1,000 924 1,061 800 717 600 530 440 400 333 200 123 0 2003 2004 2005 2006 2007 2008 2009 500 2003 15,238 2009 31,4532003 2009

More information

第三章

第三章 第 三 章 :2017 年 行 政 長 官 產 生 辦 法 - 可 考 慮 的 議 題 行 政 長 官 的 憲 制 及 法 律 地 位 3.01 基 本 法 第 四 十 三 條 規 定 : 香 港 特 別 行 政 區 行 政 長 官 是 香 港 特 別 行 政 區 的 首 長, 代 表 香 港 特 別 行 政 區 香 港 特 別 行 政 區 行 政 長 官 依 照 本 法 的 規 定 對 中 央 人

More information

nb.PDF

nb.PDF 3 4 5 7 8 9..10..15..16..19..52 -3,402,247-699,783-1,611,620 1,790,627 : - - -7,493 - -1,687 2,863 1,176 2,863 - -148,617 - - 12,131 51,325 - -12,131-2,165 14-2,157 8-3,393,968-794,198-1,620,094 1,781,367

More information

bnbqw.PDF

bnbqw.PDF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ( ( 1 2 16 1608 100004 1 ( 2003 2002 6 30 12 31 7 2,768,544 3,140,926 8 29,054,561 40,313,774 9 11,815,996 10,566,353 11 10,007,641 9,052,657 12 4,344,697

More information

南華大學數位論文

南華大學數位論文 南 華 大 學 哲 學 與 生 命 教 育 學 系 碩 士 論 文 呂 氏 春 秋 音 樂 思 想 研 究 研 究 生 : 何 貞 宜 指 導 教 授 : 陳 章 錫 博 士 中 華 民 國 一 百 零 一 年 六 月 六 日 誌 謝 論 文 得 以 完 成, 最 重 要 的, 是 要 感 謝 我 的 指 導 教 授 陳 章 錫 博 士, 老 師 總 是 不 辭 辛 勞 仔 細 閱 讀 我 的 拙

More information

Microsoft Word - 3.3.1 - 一年級散文教案.doc

Microsoft Word - 3.3.1 - 一年級散文教案.doc 光 明 英 來 學 校 ( 中 國 文 學 之 旅 --- 散 文 小 說 教 學 ) 一 年 級 : 成 語 ( 主 題 : 勤 學 ) 節 數 : 六 教 節 ( 每 課 題 一 教 節 ) 課 題 : 守 株 待 兔 半 途 而 廢 愚 公 移 山 鐵 杵 磨 針 孟 母 三 遷 教 學 目 的 : 1. 透 過 活 動, 學 生 能 說 出 成 語 背 後 的 含 意 2. 學 生 能 指

More information

第32回独立行政法人評価委員会日本貿易保険部会 資料1-1 平成22年度財務諸表等

第32回独立行政法人評価委員会日本貿易保険部会 資料1-1 平成22年度財務諸表等 1 12,403 2,892 264,553 19,517 238,008 10,132 989 36 9,869 2,218 250 122 ( 126 108 1,563 278 159 260 478 35,563 1,073 74 190,283 104,352 140,658 20,349 16,733 21,607 (21,607) 58,689 303,699 339,262 339,262

More information

1. 本文首段的主要作用是 A. 指出 異蛇 的藥用功效 說明 永之人爭奔走焉 的原因 B. 突出 異蛇 的毒性 為下文 幾死者數矣 作鋪墊 C. 交代以蛇賦稅的背景 引起下文蔣氏有關捕蛇的敘述 2. 本文首段從三方面突出蛇的 異 下列哪一項不屬其中之一 A. 顏色之異 B. 動作之異 C. 毒性之

1. 本文首段的主要作用是 A. 指出 異蛇 的藥用功效 說明 永之人爭奔走焉 的原因 B. 突出 異蛇 的毒性 為下文 幾死者數矣 作鋪墊 C. 交代以蛇賦稅的背景 引起下文蔣氏有關捕蛇的敘述 2. 本文首段從三方面突出蛇的 異 下列哪一項不屬其中之一 A. 顏色之異 B. 動作之異 C. 毒性之 1. 本文首段的主要作用是 A. 指出 異蛇 的藥用功效 說明 永之人爭奔走焉 的原因 B. 突出 異蛇 的毒性 為下文 幾死者數矣 作鋪墊 C. 交代以蛇賦稅的背景 引起下文蔣氏有關捕蛇的敘述 2. 本文首段從三方面突出蛇的 異 下列哪一項不屬其中之一 A. 顏色之異 B. 動作之異 C. 毒性之異 3. 太醫以王命聚之 中的 以 字與下列哪一項的 以 意思相同 A. 以齧人 B. 而吾以捕蛇獨存

More information

Microsoft Word - 發布版---規範_全文_.doc

Microsoft Word - 發布版---規範_全文_.doc 建 築 物 無 障 礙 設 施 設 計 規 範 內 政 部 97 年 4 年 10 日 台 內 營 字 第 0970802190 號 令 訂 定, 自 97 年 7 月 1 日 生 效 內 政 部 97 年 12 年 19 日 台 內 營 字 第 0970809360 號 令 修 正 內 政 部 101 年 11 年 16 日 台 內 營 字 第 1010810415 號 令 修 正 目 錄 第 一

More information

概 述 随 着 中 国 高 等 教 育 数 量 扩 张 目 标 的 逐 步 实 现, 提 高 教 育 质 量 的 重 要 性 日 益 凸 显 发 布 高 校 毕 业 生 就 业 质 量 年 度 报 告, 是 高 等 学 校 建 立 健 全 就 业 状 况 反 馈 机 制 引 导 高 校 优 化 招

概 述 随 着 中 国 高 等 教 育 数 量 扩 张 目 标 的 逐 步 实 现, 提 高 教 育 质 量 的 重 要 性 日 益 凸 显 发 布 高 校 毕 业 生 就 业 质 量 年 度 报 告, 是 高 等 学 校 建 立 健 全 就 业 状 况 反 馈 机 制 引 导 高 校 优 化 招 I 概 述 随 着 中 国 高 等 教 育 数 量 扩 张 目 标 的 逐 步 实 现, 提 高 教 育 质 量 的 重 要 性 日 益 凸 显 发 布 高 校 毕 业 生 就 业 质 量 年 度 报 告, 是 高 等 学 校 建 立 健 全 就 业 状 况 反 馈 机 制 引 导 高 校 优 化 招 生 和 专 业 结 构 改 进 人 才 培 养 模 式 及 时 回 应 社 会 关 切 的 一 项

More information

鱼类丰产养殖技术(二).doc

鱼类丰产养殖技术(二).doc ...1...1...4...15...18...19...24...26...31...35...39...48...57...60...62...66...68...72 I ...73...88...91...92... 100... 104... 144... 146... 146... 147... 148... 148... 148... 149... 149... 150... 151...

More information

疾病诊治实务(一)

疾病诊治实务(一) ...1...4...5...8...13...14...15...18...18...19...22...25...26...27...29...30...32...35 I ...38...42...43...45...48...51...53...56...59...60...60...61...63...65...67...69...72...74...77...80...82...84 II

More information

名人养生.doc

名人养生.doc I...1...3...4...6... 11...14...18...22...26...29...31...38...45...49...56...57...59...61...67 ...72...73...75...77...80...83...85...91...92...93...95...96...97... 103... 107... 109... 110... 112... 118...

More information

<4D6963726F736F667420576F7264202D2040B9C5B871A661B0CFABC8AE61C2A7AB55ACE3A8735FA7F5ABD8BFB3B9C5B871A661B0CFABC8AE61C2A7AB55ACE3A8732E646F63>

<4D6963726F736F667420576F7264202D2040B9C5B871A661B0CFABC8AE61C2A7AB55ACE3A8735FA7F5ABD8BFB3B9C5B871A661B0CFABC8AE61C2A7AB55ACE3A8732E646F63> 嘉 義 地 區 客 家 禮 俗 研 究 第 一 章 前 言 嘉 義 地 區 的 客 家 族 群 約 略 可 分 為 福 佬 客 詔 安 客 與 北 部 客 等 三 種 類 別, 其 分 佈 區 域 以 海 線 地 區 平 原 地 形 沿 山 地 區 為 主 有 相 當 多 的 北 部 客 家 人, 是 二 次 大 戰 末 期 和 戰 後 初 期 才 移 民 嘉 義, 是 什 麼 因 素 令 許 多

More information

05301930

05301930 國 立 中 正 大 學 法 學 系 碩 士 論 文 河 川 砂 石 法 規 範 之 探 討 - 以 採 取 土 石 及 挖 掘 河 川 認 定 基 準 為 主 指 導 教 授 : 盧 映 潔 博 士 研 究 生 : 王 瑞 德 中 華 民 國 一 百 零 一 年 五 月 目 錄 第 一 章 緒 論... 1 第 一 節 研 究 動 機... 1 第 二 節 研 究 目 的... 3 第 三 節 研

More information

中老年保健必读(十).doc

中老年保健必读(十).doc ...1...2...3...4...5...6...8...9... 11 - -...13...15...17...18...20...22...23...25...26...28 I II...30...32...34...35...38...40...42...44...46...47...48...50...52...53 X...55...56...57...58...60...61...63...65

More information

23 29 15.6% 23 29 26.2% 3 25 2 15 1 5 1,542 12,336 14,53 16,165 18,934 22,698 25,125 25 2 15 1 5 5,557 7,48 8,877 11, 13,732 17,283 22,485 23 24 25 26

23 29 15.6% 23 29 26.2% 3 25 2 15 1 5 1,542 12,336 14,53 16,165 18,934 22,698 25,125 25 2 15 1 5 5,557 7,48 8,877 11, 13,732 17,283 22,485 23 24 25 26 4, 197823 2916.3%29 335, 23 29.5% 23 29 16.3% 14 35 33,535 14 135 13 125 1,292 1,3 1,38 1,314 1,321 1,328 1,335 3 25 2 15 1 5 1. 1.1 13,582 15,988 1.4 18,322 11.6 11.9 21,192 24,953 3,67 9. 8.7 12 1 8

More information

海淀区、房山区(四)

海淀区、房山区(四) ...1...1...2...7...8...9... 11... 15... 17... 17... 18... 19... 20... 21... 23... 25... 28... 31... 32 I ... 35... 36... 37... 39... 42... 43... 48... 53... 54... 58... 63... 64... 65... 66... 68... 71...

More information