epub 33-8
|
|
|
- 声因 李
- 7 years ago
- Views:
Transcription
1 8 1) 2) 3) A S C I I 4 C I / O I / 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; /* /* /* /* /*
2 1 5 4 C FILE FILE *fp1,fp2; f p 1 f p 2 2. ANSI C FILE *fopen(char *fname,char *mode) s t d i o. h f o p e n () f n a m e f n a m e m o d e m o d e 8-1 m o d e 8-1 mode Mode r w a r b w b a b r + w + a + r b + w b + a b / / / / / / 8-1 FILE *fp; If ((fp=fopen("test.txt","w"))==null) /* printf("cannot open file \n"); N U L L N U L L s t d i o. h 0
3 ANSI C int fclose(file *stream) f c l o s e () s t r e a m f c l o s e () s t r e a m f c l o s e () 0 [ 8-1] m a i n ( ) FILE *fp; If ((fp=fopen("test.dat","rb"))==null) printf("cannot open file\n"); e x i t ( 0 ) ; / * * / if (fclose(fp)) printf("file close error!\n"); C f g e t c f p u t c s t d i o. h int fgetc(file *stream) f g e t c ( ) E O F int fputc(int ch,file *stream) f p u t c c h fputc () E O F [ 8-2] m a i n () main( argc,argv) int argc;
4 1 5 6 C char *argv[]; char ch; FILE *fp; int i; i f (( f p = f o p e n ( a r g v [ 1 ]," r ")) = = N U L L ) printf("not open"); while ((ch=fgetc(fp))!=eof) p u t c h a r ( c h ); f c l o s e ( f p ); /* a r g v [ 1 ] /* m a i n () a rg c a rg v a rg c L 8-2. c L 8-2. e x e l 8-2. e x e c : \ t c > l8-2 L8-2.c a rg v [ 0 ] = " c :\ t c > l 8-2 " a rgv[1]=" L8-2.c " a rg c = 2 L8-2.c f g e t c () C E O F c : \ t c > l8-2 L8-2.c main( argc,argv) int argc; char *argv[]; char ch; FILE *fp; int i; i f (( f p = f o p e n ( a r g v [ 1 ]," r ")) = = N U L L ) printf("not open"); while ((ch=fgetc(fp))!=eof) p u t c h a r ( c h ); f c l o s e ( f p ); /* a r g v [ 1 ] /* [ 8-3] t e s t. t x t m a i n ( )
5 FILE fp; char ch; i f (( f p = f o p e n (" t e s t. t x t "," w ")) = = N U L L ) printf("cannot open file!\n"); while ((ch=fgetchar())!='\n') f p u t c ( c h, f p ) f c l o s e ( f p ); /* /* / / t e s t. t x t D O S t y p e R U N I love china! D O S type t e s t. t x t c : \ t c > type test.txt I love china! 2. C s t d i o. h Char *fgets(char *str,int num,file *stream) fgets() s t r e a m n u m - 1 s t r E O F int fputs(char *str,file *stream) f p u t s () s t r 0 [ 8-4] t e s t. t x t #include <string.h> m a i n () FILE *fp; char str[128]; if ((fp=fopen("test.txt","w"))==null) /* printf("cannot open file!"); w h i l e (( s t r l e n ( g e t s ( s t r )))! = 0 ) /* f p u t s ( s t r, f p ); /* fputs("\n",fp); /*
6 1 5 8 C fclose(fp); /* H e l l o! How do you do G o o d - b y e! d o s t y p e c : \ t c > type test.txt H e l l o! How do you do Good-bye! g e t s [ 8-5] t e s t 1. t x t t e s t 2. t x #include <string.h> m a i n () FILE *fp1,*fp2; char str[128]; if ((fp1=fopen("test1.txt","r"))==null) /* 1 printf("cannot open file\n"); if ((fp2=fopen("test2.txt","w"))==null) /* 2 printf("cannot open file\n"); while ((strlen(fgets(str,128,fp1)))>0) /* 0 fputs(str,fp2 ); /* 1 2 p r i n t f ("% s ", s t r ); /* f c l o s e ( f p 1 ); f c l o s e ( f p 2 );
7 s c a n f () p r i n t f () f f s c a n f () f p r i n t f ( ) int fscanf(file *stream,char *format,arg_list) int fprintf(file *stream,char *format,arg_list) s t r e a m s c a n f () p r i n t f () [ 8-6] m a i n () FILE *fp; int i; struct stu char name[15]; char num[6]; float score[2]; /* s t u d e n t ; /* if ((fp=fopen("test1.txt","w"))==null) /* printf("input data:\n"); for( i=0;i<2;i++) scanf("%s %s %f %f",student.name,student.num,&student.score[0], &student.score[1]); /* fprintf(fp,"%s %s %7.2f %7.2f\n",student.name,student.num, s t u d e n t. s c o r e [ 0 ], s t u d e n t. s c o r e [ 1 ]); /* f c l o s e ( f p ); /* if ((fp=fopen("test.txt","r"))==null) /* printf("output from file:\n"); while (fscanf(fp,"%s %s %f %f\n",student.name,student.num, & s t u d e n t. s c o r e [ 0 ], s t u d e n t. s c o r e [ 1 ])! = E O F /* printf("%s %s %7.2f %7.2f\n",student.name,student.num,
8 1 6 0 C student.score[0],student.score[1]); /* fclose(fp); /* input data: xiaowan j xiaoli j output from file: xiaowan j xiaoli j c :\ > type test.txt xiaowan j xiaoli j if ((fp=fopen("test1.txt","wb"))==null) /* 4. C int fread(void *buf,int size,int count,file *stream) int fwrite(void *buf,int size,int count,file *stream) fread stream count s i z e ( ) b u f fread f w r i t e () b u f ( ) c o u n t ( ) s t r e a m s i z e [ 8-7] #include "stdio.h" #include "stdlib.h" m a i n ( ) FILE *fp1;
9 8 161 int i; struct stu /* char name[15]; char num[6]; float score[2]; s t u d e n t ; if ((fp1=fopen("test.txt","wb"))==null) /* printf("input data:\n"); for( i=0;i<2;i++) scanf("%s %s %f %f",student.name,student.num, & s t u d e n t. s c o r e [ 0 ],& s t u d e n t. s c o r e [ 1 ]); /* fwrite(&student,sizeof(student),1,fp1); /* f c l o s e ( f p 1 ); if ((fp1=fopen("test.txt","rb"))==null) /* printf("output from file:\n"); for (i=0;i<2;i++) f r e a d (& s t u d e n t, s i z e o f ( s t u d e n t ), 1, f p 1 );/ * printf("%s %s %7.2f %7.2f\n",student.name,student.num, s t u d e n t. s c o r e [ 0 ], s t u d e n t. s c o r e [ 1 ]); /* f c l o s e ( f p 1 ); input data: xiaowan j xiaoli j output from file: xiaowan j xiaoli j C : int atoi(char *ptr) float atof(char *ptr) long int atol(char *ptr) m a t h. h
10 1 6 2 C s t d l i b. h [ 8-8] #include <stdlib.h> m a i n () FILE *fp1; char *temp; int i; struct stu char name[15]; /* char num[6]; /* float score[2]; s t u d e n t ; if ((fp1=fopen("test.txt","wb"))==null) for( i=0;i<2;i++) printf("input name:"); g e t s ( s t u d e n t. n a m e ); printf("input num:"); g e t s ( s t u d e n t. n u m ); printf("input score1:"); g e t s ( t e m p ); s t u d e n t. s c o r e [ 0 ] = a t o f ( t e m p ); printf("input score2:"); g e t s ( t e m p ); s t u d e n t. s c o r e [ 1 ] = a t o f ( t e m p ); /* / * /* /* /* /* f w r i t e (& s t u d e n t, s i z e o f ( s t u d e n t ), 1, f p 1 ); f c l o s e ( f p 1 ); /* if ((fp1=fopen("test.txt","rb"))==null) e x i t ( 0 ) ; p r i n t f ( " \ n " ) ; p r i n t f ( " % s % - 7 s % - 7 s % - 7 s \ n ", " n a m e ", " n u m ", " s c o r e 1 ", " s c o r e 2 " ) ; p r i n t f ( " \ n " ) ; for (i=0;i<2;i++) f r e a d ( & s t u d e n t, s i z e o f ( s t u d e n t ), 1, f p 1 ) ; p r i n t f ( " % s % - 7 s % 7. 2 f % 7. 2 f \ n ", s t u d e n t. n a m e, s t u d e n t. n u m, s t u d e n t. s c o r e [ 0 ], s t u d e n t. s c o r e [ 1 ] ) ;
11 8 163 f c l o s e ( f p 1 ) ; R U N input name:l i - y i n g input num: j input score1: input score2: input name:l i - l i input num: j input score1: input score2: n a m e n u m s c o r e 1 s c o r e l i - y i n g j l i - l i j C int fseek(file *fp,long d,int pos) f p d p o s P o s d l o n g 0 f s e e k ( f p, 5 L, 0 ) 5 [ 8-9] f s e e k ( f p,- 10 L, 2 ) 10 rewind() ftell(file *fp) 5 #include <stdlib.h> #define n 5 m a i n ( ) FILE *fp1; /*
12 1 6 4 C char *temp; int i,j; struct stu char name[15]; char num[6]; float score[2]; s t u d e n t [ n ]; /* if ((fp1=fopen("test.txt","wb"))==null) for( i=0;i<n;i++) printf("input name:"); g e t s ( s t u d e n t [ i ]. n a m e ); printf("input num:"); g e t s ( s t u d e n t [ i ]. n u m ); printf("input score1:"); g e t s ( t e m p ); s t u d e n t [ i ]. s c o r e [ 0 ] = a t o f ( t e m p ); printf("input score2:"); g e t s ( t e m p ); s t u d e n t [ i ]. s c o r e [ 1 ] = a t o f ( t e m p ) ; /* /* /* /* /* fwrite(&student[i],sizeof(struct stu),1,fp1); /* fclose(fp1); /* if ((fp1=fopen("test.txt","rb+"))==null) /* p r i n t f (" \ n "); p r i n t f ("% - 15 s %- 7 s %- 7 s %- 7 s \ n "," n a m e "," n u m "," s c o r e 1 "," s c o r e 2 "); p r i n t f (" \ n "); for (i=0;i<n;i++) /* fread(&student[i],sizeof(struct stu),1,fp1); p r i n t f ("% - 15 s %- 7 s % 7. 2 f % 7. 2 f \ n ", s t u d e n t [ i ]. n a m e, s t u d e n t [ i ]. n u m, s t u d e n t [ i ]. s c o r e [ 0 ], s t u d e n t [ i ]. s c o r e [ 1 ]); /* fseek(fp1,3*sizeof(struct stu),0); /* fwrite(&student[1],sizeof(struct stu),1,fp1); /* rewind(fp1); /* p r i n t f (" \ n ");
13 8 165 p r i n t f ( " % s % - 7 s % - 7 s % - 7 s \ n ", " n a m e ", " n u m ", " s c o r e 1 ", " s c o r e 2 " ) ; p r i n t f ( " \ n " ) ; for (i=0;i<n;i++) /* fread(&student[i],sizeof(struct stu),1,fp1); p r i n t f ("% - 15 s %- 7 s % 7. 2 f % 7. 2 f \ n ", s t u d e n t [ i ]. n a m e, s t u d e n t [ i ]. n u m, s t u d e n t [ i ]. s c o r e [ 0 ], s t u d e n t [ i ]. s c o r e [ 1 ]); f c l o s e ( f p 1 ) ; /* R U N input name:l i - y i n g input num: j input score1: input score2: input name:l i - l i input num: j input score1: input score2: input name:l i - p i n g input num: j input score1: input score2: input name:w a n g - x i a n input num: j input score1:9 8 input score2:94 input name:m a - l i n g input num: j input score1: input score2: n a m e n u m s c o r e 1 s c o r e l i - y i n g j l i - l i j l i - p i n g j Wang-xian j Ma-ling j n a m e n u m s c o r e 1 s c o r e l i - y i n g j l i - l i j l i - l i j Wang-xian j
14 1 6 6 C M a - l i n g j A N S I 1. A N S I U N I X I / O i o. h int open(char *fname,int access) f n a m e a c c e s s a c c e s s O _ R D O N LY O _ W R O N LY O _ R D W R close(int fd) U N I X #include "io.h" #include "fcntl.h" #include "sys\stat.h" m a i n ( a r g c, a r g v ) int argc; char *argv[] int fd; if((fd=open(argv[1],o_rdonly))==-1) /* printf("cannt open file!"); printf("file existent!"); if (close(fd)) printf("error in closing file\n"); 2. i o. h int read(int fd,void *buf,int count) r e a d () f d c o u n t b u f
15 8 167 int write(int fd,void *buf,int count) w r i t e () c o u n t b u f f d T E S T. T S T 100 b u ff e r #include "io.h" #include "stdio.h" #include "fcntl.h" m a i n () int fd; char buffer[100]; if ((fd=open("test.tst",o_rdonly))==-1) /* printf("cannot open file!\n"); if (read(fd,buffer,100)!=100) /* printf("possible read error."); 8.3 [ 8-10] a d d r. t x t t e l. t x t a d d r t e l. t x t type addr.txt h e j i e t i a n j i n g l i y i n g s h a n g h a i l i m i n g c h e n g d u w a n g p i n c h o n g q i n g type tel.txt l i y i n g h e j i e w a n g p i n l i m i n g
16 1 6 8 C #include <stdlib.h> #include <conio.h> #include <string.h> m a i n ( ) FILE *fptr1,*fptr2,*fptr3; /* char temp[15],temp1[15],temp2[15]; if ((fptr1=fopen("addr.txt","r"))==null)/* if ((fptr2=fopen("tel.txt","r"))==null) if ((fptr3=fopen("addrtel.txt","w"))==null) c l r s c r (); /* while(strlen(fgets(temp1,15,fptr1))>1) /* 1 f g e t s ( t e m p 2, 15, f p t r 1 ); /* f p u t s ( t e m p 1, f p t r 3 ); /* f p u t s ( t e m p 2, f p t r 3 ); /* s t r c p y ( t e m p, t e m p 1 ); /* do /* f g e t s ( t e m p 1, 15, f p t r 2 ); f g e t s ( t e m p 2, 15, f p t r 2 ); while (strcmp(temp,temp1)!=0); r e w i n d ( f p t r 2 ); /* f p u t s ( t e m p 2, f p t r 3 ); /* f c l o s e ( f p t r 1 ); f c l o s e ( f p t r 2 ); f c l o s e ( f p t r 3 ); /*
17 8 169 a d d r t e l. t x t type addrtel.txt hejie tianjing liying shanghai liming chengdu wangpin chongqing
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 ;
C
C 14 2017 5 31 1. 2. 3. 4. 5. 2/101 C 1. ( ) 4/101 C C ASCII ASCII ASCII 5/101 C 10000 00100111 00010000 ASCII 10000 31H 30H 30H 30H 30H 1 0 0 0 0 0 ASCII 6/101 C 7/101 C ( ) ( ) 8/101 C UNIX ANSI C 9/101
实际问题 : 1 职工信息管理系统 2 学生选课系统 3 飞机订票系统 4 图书信息管理系统 5 图象处理
实际问题 : 1 职工信息管理系统 2 学生选课系统 3 飞机订票系统 4 图书信息管理系统 5 图象处理 10.1 C 文件概述 文件 : 存储在外部介质上数据的集合, 是操作系统数据管理的单位使用数据文件的目的 文件分类 1 数据文件的改动不引起程序的改动 程序与数据分离 2 不同程序可以访问同一数据文件中的数据按文件的逻辑结构 : 数据共享 3 能长期保存程序运行的中间数据或结果数据 记录文件
新版 明解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
新・明解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
プログラムの設計と実現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
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
附錄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
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) (
新・解きながら学ぶ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
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;
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!=
攝 心 為 戒, 因 戒 而 生 定, 由 定 而 生 慧
攝 心 為 戒, 因 戒 而 生 定, 由 定 而 生 慧 序 言 談 佛 教 戒 律 論 修 行 念 佛 多 如 牛 毛 往 生 極 樂 少 如 牛 角 戒 律 者, 如 同 國 之 法 律, 民 不 守 之, 則 社 稷 亂 矣, 而 修 行 者, 不 守 戒, 則 道 不 成, 宗 教 崩 廢 不 堪 矣 國 法 乃 依 行 而 論 處, 戒 律 者, 乃 心 行 皆 論, 較 之 嚴 謹 今
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
CC213
: (Ken-Yi Lee), E-mail: [email protected] 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] : ,
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
PowerPoint 演示文稿
第 13 章外存中数据的组织 文件 本章的基本内容是 : 概述 文件的打开与关闭 文件的读写操作 任务 13.1 统计入学成绩 ( 文件版 ) 问题 某大学的博士入学考试科目为外语和两门专业课, 对于每个考生, 输入各科考试成绩并计算总分 要求用文件实现 想法 已经录入的成绩信息应该用文件保存下来, 已经计算的总分也应该保存到文件中, 并已追加方式继续录入 算法 文件 student.txt 存放学生的成绩信息,
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,
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
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
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
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:
chap12.ppt
第十二章 文件 C ( 前所讲 ) 程序 ( 可包含若干源程序文件 ) 文件 也属于. 目的 : 使程序操作中的数据得以长期保存 一 概述 OS 以文件为单位对数据进行存储管理 流与文件流 :C 提供的一个 I/O 统一接口, 与具体的被访问设备无关 把 I/O 工作抽象成从源到目地的流, 所有的 I/O 通过流来进行, 所有流都具有相同的行为 文件 : 指具体的实际设备 ( 一切具有 I/O 能力的外部设备
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
Microsoft Word - 实用案例.doc
计 算 机 系 统 应 用 2009 年 第 12 期 嵌 入 式 Linux 下 温 湿 度 传 感 器 的 设 计 与 实 现 1 Design and Implementation of Temperature and Humidity Sensor Based on Embedded Linux 陈 博 刘 锦 高 ( 华 东 师 范 大 学 电 子 科 学 技 术 系 上 海 200241)
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",
第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
C语言的应用.PDF
AVR C 9 1 AVR C IAR C, *.HEX, C,,! C, > 9.1 AVR C MCU,, AVR?! IAR AVR / IAR 32 ALU 1KBytes - 8MBytes (SPM ) 16 MBytes C C *var1, *var2; *var1++ = *--var2; AVR C 9 2 LD R16,-X ST Z+,R16 Auto (local
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;
ebook15-C
C 1 1.1 l s ( 1 ) - i i 4. 14 - d $ l s -ldi /etc/. /etc/.. - i i 3077 drwxr-sr-x 7 bin 2048 Aug 5 20:12 /etc/./ 2 drwxr-xr-x 13 root 512 Aug 5 20:11 /etc/../ $ls -ldi /. /..... i 2 2 drwxr-xr-x 13 root
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
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 [email protected] 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
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,,, ( ),,,,,
FY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
_汪_文前新ok[3.1].doc
普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向
第一章
1 2 3 4 5 6 7 8 9 10 11 12 13 14 1500 1450 1400 1350 1300 1250 1200 15 16 17 18 19 20 21 22 23 24 25 26 27 28 INPUT2006 29 30 31 32 33 34 35 9000 8500 8000 7500 7000 6500 6000 5500 5000 4500 4000 3500
IO
1 C/C++ C FILE* fscanf fgets fread fprintf fputs fwrite C++ ifstream ofstream >>
文件
CH10 文件 1 文件的概念 一 文件分类 二 文件的组织结构 : ASCII 码文件 ( 文本文件 ) 二进制文件 文件是二进制代码的, 则文件就是字节流 文件是 ASCII 码的, 则文件就是字符流, 也是字节流 1 如 : 对于整型变量 x, 其值为 32767 若以文本方式存放, 则共有 5 个字符, 内容为 : 00110011 00110010 00110111 00110110 00110111
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
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 [email protected] 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,
( 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.
ebook8-30
3 0 C C C C C C++ C + + C++ GNU C/C++ GNU egcs UNIX shell s h e l l g a w k P e r l U N I X I / O UNIX shell awk P e r l U N I X C C C C C C U N I X 30.1 C C U N I X 70 C C U N I X U N I X U N I X C Dennis
新版 明解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,
11. 下列关于文件的结论中正确的是 ( ) A. 对文件操作必须先关闭文件 B. 对文件操作必须先打开文件 C. 对文件的操作顺序没有统一规定 D. 以上三种答案全是错误的 12. 若以 a+ 方式打开一个已存在的文件, 则以下叙述正确的是 ( ) A. 文件打开时, 原有文件内容不被删除, 位置
单元 5 构造类型程序设计 文件 同步训练 一 单项选择题 1. 系统的标准输入文件是指 ( ) A. 键盘 B. 显示器 C.U 盘 D. 硬盘 2. 在进行文件操作时, 写文件的一般含义是 ( ) A. 将计算机内存在的信息存入磁盘 B. 将磁盘中的信息存入计算机内存 C. 将计算机 CPU 中的信息存入磁盘 D. 将磁盘中的信息存入计算机 CPU 3. 系统的标准输出文件是指 ( ) A. 键盘
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 ;
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
untitled
MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12
<4D6963726F736F667420506F776572506F696E74202D20312EB9FEB6FBB1F5B9A4D2B5B4F3D1A7D5E7C1BCA3BAC3E6CFF2D1D0BEBFC9FAB8B4CAD4B5C4BDE1B9B9BBAFC3E6CAD4BFBCBACBCCBDCBF7D3EBCAB5BCF92E707074205BBCE6C8DDC4A3CABD5D>
面 向 研 究 生 复 试 的 结 构 化 面 试 考 核 探 索 与 实 践 哈 尔 滨 工 业 大 学 甄 良 2015 年 11 月 5 日 一 背 景 情 况 ( 一 ) 研 究 生 招 生 的 政 策 背 景 招 生 是 一 个 教 育 热 点, 也 是 一 个 社 会 热 点 国 家 重 要 的 教 育 领 域 改 革 文 件 都 对 招 生 改 革 出 了 明 确 要 求 国 务 院
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
中北大学常规事项财务报销操作指南
中 北 大 学 常 规 事 项 财 务 报 销 操 作 指 南 一 办 公 费 报 销 指 南 定 义 : 办 公 费 是 单 位 购 买 按 财 务 会 计 制 度 规 定 不 符 合 固 定 资 产 标 准 的 日 常 办 公 用 品 书 报 杂 志 等 支 出 通 俗 讲 是 指 办 公 场 所 使 用 的 低 值 易 耗 品 办 公 用 品 的 类 别 : 纸 薄 类 笔 尺 类 装 订 类
CC213
: (Ken-Yi Lee), E-mail: [email protected] 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++
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.
[改訂新版]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
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,
Microsoft PowerPoint - C_Structure.ppt
結構與其他資料型態 Janet Huang 5-1 結構的宣告 struct 結構名稱 struct 結構名稱變數 1, 變數 2,, 變數 m; struct 結構名稱 變數 1, 變數 2,, 變數 m; student; student; 5-2 1 結構變數初值的設定 struct 結構名稱 struct 結構名稱變數 = 初值 1, 初值 2,, 初值 n student="janet","1350901",100,95
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
Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2
Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790
牧 者 心 聲 要 因 心 懷 平 而 作 惡 要 謹 慎 言 行 免 得 舌 頭 犯 罪 ; 惡 人 時 候 要 用 嚼 環 勒 住 口 ( 詩 三 十 九 1) 今 天 社 會 和 教 會 裏 極 其 渴 望 人 能 以 具 體 行 動 勉 勵 走 善 良 正 直 路 作 好 榜 樣 ; 可 惜
週 六 崇 拜 秩 序 2010 年 7 24 日 下 午 500 主 席 王 和 祥 牧 長 講 員 蕭 壽 華 牧 師 司 琴 沈 慧 珍 小 姐 會 眾 開 始 以 心 靈 與 實 敬 拜 進 堂 ( 主 禮 人 及 詩 班 ) 始 禮 頌 ( 歌 詞 見 第 4 頁 ) 宣 召 心 必 靠 耶 和 華 快 樂 靠 祂 救 恩 高 興 舌 頭 要 終 日 論 說 祢 公 義 時 常 讚 美 祢
2008年4月全国计算机等级考试二级C语言真题(含答案)
2008 年 4 月 全 国 计 算 机 等 级 考 试 二 级 C 语 言 真 题 ( 含 答 案 ) 一 选 择 题 ( 共 70 分 ) 下 列 各 题 A),B),C),D) 四 个 选 项 中, 只 有 一 个 选 项 是 正 确 的, 请 将 正 确 选 项 涂 写 在 答 题 卡 相 应 位 置 上, 答 在 试 卷 上 不 得 分 (1) 程 序 流 程 图 中 指 有 箭 头 的
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
C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha
CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc
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
硕士论文正文
... 3... 11... 18... 21... 26... 29... 31... 35... 41... 44... 48... 52... 54... 56... 58... 61... 62... 64... 65... 67... 69... 71... 73... 76... 78... 80... 82... 84 ... 85... 87... 92... 93... 94...
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;
入 学 考 试 重 点 考 查 学 生 的 基 础 专 业 知 识 基 本 实 验 操 作 技 能 独 立 思 考 和 动 手 能 力 笔 试 和 面 试 的 试 题 都 有 足 够 的 难 度, 以 利 择 优 录 取 新 录 取 的 研 究 生 第 一 次 见 面, 池 先 生 会 作 一 次
严 师 慈 母 池 际 尚 院 士 培 养 研 究 生 记 实 叶 德 隆 叶 德 隆, 男,1936 年 12 月 初 生 中 国 地 质 大 学 ( 武 汉 ) 地 球 科 学 学 院 教 授 1960 年 北 京 地 质 学 院 岩 石 矿 物 学 专 业 毕 业 并 留 校 任 教,1962 年 北 京 地 质 学 院 研 究 生 毕 业 主 要 从 事 岩 浆 岩 岩 石 学 晶 体 光
untitled
1 7 7.1 7.2 7.3 7.4 7.5 2 7.1 VFT virtual 7.1 3 1 1. 2. public protected public 3. VFT 4. this const volatile 4 2 5. ( ) ( ) 7.1 6. no-static virtual 7.2 7. inline 7.3 5 3 8. this this 9. ( ) ( ) delete
学习MSP430单片机推荐参考书
MSP430 16 MSP430 C MSP430 C MSP430 FLASH 16 1 CPU 16 ALU 16 PC SP SR R4~R15 2 3 00-FFH 100-1FFH 4 5 1 2 51 24 27 6 1 2 3 4 5 6 4 12 SR SP SR CPU SR CPU C Z N GIE CPUOff CPU OscOff SCG0 SCG1 CPU EXIT SP
<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
Go构建日请求千亿微服务最佳实践的副本
Go 构建 请求千亿级微服务实践 项超 100+ 700 万 3000 亿 Goroutine & Channel Goroutine Channel Goroutine func gen() chan int { out := make(chan int) go func(){ for i:=0; i
C6_ppt.PDF
C01-202 1 2 - (Masquerade) (Replay) (Message Modification) (Denial of Service) - ( ) (Eavesdropping) (Traffic Analysis) 8 1 2 7 3 6 5 4 3 - TCP SYN (SYN flood) Smurf Ping of Death LAND Attack Teardrop
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.
(Guangzhou) AIT Co, Ltd V 110V [ ]! 2
(Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn Xi III Zebra XI III 1 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn 230V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666
全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明
How to Debug Tuxedo Server printf( Input data is: %s, inputstr); fprintf(stdout, Input data is %s, inputstr); fprintf(stderr, Input data is %s, inputstr); printf( Return data is: %s, outputstr); tpreturn(tpsuccess,
Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc
2 5 8 11 0 1. 13 2. 15 3. 18 1 1. 22 2. 25 3. 27 2 1. 35 2. 38 3. 41 4. 43 5. 48 6. 50 3 1. 56 2. 59 3. 63 4. 65 5. 69 13 22 35 56 6. 74 7. 82 8. 84 9. 87 10. 97 11. 102 12. 107 13. 111 4 114 1. 114 2.
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
