Microsoft Word - ¤W½Ò¤º®e RTF

Size: px
Start display at page:

Download "Microsoft Word - ¤W½Ò¤º®e RTF"

Transcription

1 (variable) &( ) ( ) 0 9 A...Z a z under line( _ ) 1) (A...Z a z) 2) case sensitive 3) C/C++ (reserved word or key word) 1, 2,.., n char ch; int m; int n; int m, n; // float f = 10.0; // double d =f * 10.0; // float *ptr, a; // float *ptr; float a; byte sizeof sizeof // sizeof is a key word in C & C++ float f; sizeof(float) or sizeof(f) Pointer 1) 2) 3) pointer + k pointer k Pointer float a=1, b=2, c=3; float *fptr; fptr = &c; Show sizeof(char *)= sizeof(int *)= sizeof(double *)= C/C++ 程式設計 -1

2 * (array) ( constant pointer) [ ] Ex. float fa[2]; short int ia[4]; // sizeof(short int)=2 assumed &( ): 表示該 所在的位址 *( ): 存於此 的值或內容 fa[0] fa[1] ia[0] ia[1] ia[2] ia[3] * (index 0) (row major) int ia[4]={1,3,5; ia[0]=1; ia[1]=3, ia[2]=5, ia[3]=0 int m[2][3]={ 1, 2, 3, 4, 5, 6; int ma[2][3]={ 1, 2, 3, 4 ; int mb[2][3]={ { 1, 2, 3, { 4, 5, 6 ; int mc[2][3]= { { 1, 2, { 4 ; * compiler int ib[]={2,4,6,8; => int ib[4]={2,4,6,8; * ex. sizeof(ib)/sizeof(ib[0]); => As ib above, we get 4, the total elements of array ib; * (copy) ex. int iax[4]={5,4,3,8; int iay[4]; 1) iay=iax; // What's wrong? 2) for ( k=0; k<4; k++) iay[k]=iax[k]; // copy array elements one by one C/C++ 程式設計 -2

3 C++ operators are divided into 16 categories. The #1 category has the highest precedence; category #2 (Unary operators) takes second precedence, and so on to the Comma operator, which has lowest precedence. The operators within each category have equal precedence. The Unary (category #2), Conditional (category #14), and Assignment (category #15) operators associate right-to-left; all other operators associate left-to-right. Precedence of Operators Category Operator What it is (or does) 1. Highest () [] -> ::. 2. Unary! ~ & * sizeof new delete 3. Multiplicative * / % 4. Member access.* ->* 5. Additive Shift << >> 7. Relational < <= > >= 8. Equality == Function call Array subscript C++ indirect component selector C++ scope access/resolution C++ direct component selector Logical negation (NOT) Bitwise (1's) complement Unary plus Unary minus Preincrement or postincrement Predecrement or postdecrement Address Indirection (returns size of operand, in bytes) (dynamically allocates C++ storage) (dynamically deallocates C++ storage) Multiply Divide Remainder (modulus) C++ dereference C++ dereference Binary plus Binary minus Shift left Shift right Less than Less than or equal to Greater than Greater than or equal to Equal to Not equal to Association ( left-to-right ) right-to-left!= 9. & Bitwise AND 10. ^ Bitwise XOR 11. Bitwise OR 12. && Logical AND 13. Logical OR 14. Conditional?: (a? x : y means "if a then x, else y") right-to-left C/C++ 程式設計 -3

4 15. Assignment = *= /= %= += -= &= ^= = <<= >>= Simple assignment Assign product Assign quotient Assign remainder (modulus) Assign sum Assign difference Assign bitwise AND Assign bitwise XOR Assign bitwise OR Assign left shift Assign right shift 16. Comma, Evaluate All of the operators in this table can be overloaded except the following: right-to-left. C++ direct component selector.* C++ dereference :: C++ scope access/resolution?: Conditional (* Data copied from Turbo C++ 3.0, checks your compiler which you are using to make sure have same precedence as above showing. ) (* There are some compilers, one such as Java, the postincrement (++) and postdecrement (--) have higher precedence than equal sign, =, so the variables must be added 1 or subtracted 1 before assigning evaluated value to the variable at left of equal assign. ) * int *iptr; int a[5]; &a[2] => &(a[2]) // the address of element a[2] *iptr++ *=10; => *(iptr++) *=10; // *iptr = *iptr * 10; *iptr = *iptr *10 *stuptr.score[1] => *( (stuptr.score)[1] ) int *ary[10]; // ary, the array of int * with 10 elements int (*ary)[10]; // ary, a pointer points to int array with 10 elements float *pfun(); // pfun, a function returns float float (*pfun)(); // pfun, a pointer points to a function with float value return. C/C++ 程式設計 -4

5 int a[4]; a: 表示陣列開始的位址或更精確的說該陣列第㆒個元素所在的位址 &a: 陣列 a 的位址或陣列 a 從那㆒位址開始, 顯然 &a=a a[0]: 表示陣列第㆒個元素的內含值 以此例來說是㆒個整數 &a[0]: 表示陣列第㆒個元素所在的位址, 也就是說 : 陣列開頭的位址 於是有 : &a[0] = &a = a int a[10], float f[5]; int *iptr; float *fptr; iptr = a; fptr = f; // iptr,fptr 分別指向陣列 a, f * ( f + k ) = f [ k ] f fptr f+1 fptr+1 f+2 fptr+2 f+3 fptr+3 f+4 fptr+4 f[0]=*f f[1]=*(f+1) f[2]=*(f+2) f[3]=*(f+3) f[4]=*(f+4) a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] iptr+0 iptr+1 iptr+2 iptr+3 iptr+4 iptr+5 iptr+6 iptr+7 iptr+8 iptr+9 ex. *(fptr) = *fptr => f[0]; *(fptr+3) => f[3]; *iptr+4 => (*iptr)+4 => a[0]+4 而不是 a[4] iptr + 1: 會指向 iptr 所指位址的 ㆒個整數的位址 fptr + 1: 會指向 fptr 所指位址的 ㆒個浮點數的位址 指標加 1: 表示指向 ㆒個元素, 至於元素的大小, 則依先前的宣告而定! 指標 (pointer): 與原先宣告的資料型態有很大的關係! C/C++ 程式設計 -5

6 * ( ) ex. string ( ) ex. a * 0 char [ ]; ex. char msg[10]= abc ; // ( 10-1 = 9) msg a b c \0 msg[5]= 6 ; msg= abc ; if msg[7]=0; then msg= a ; msg a \0 c \0 Ex. for (k=9; k>0; --k) { msg[k]=0; printf( %s\n, msg ); abc ab a C/C++ s1=s1+ test ; msg= testmsg ; msg * strlen(s) // strlwr(s) // strupr(s) // strcat(s1, s2) // s1 = s1+s2 s1 strcpy(s1, s2) // s1 = s2 s1 strcmp(s1, s2) int mystrlen(char *str) // less than s2, <0 { int len=0; // the same as s2, = 0 while (*str++) len++; // greater than s2, >0 return (len); C/C++ 程式設計 -6

7 float f; f 是 float *fptr; fptr 是個, 它可以存放 float 型態變數的位址 float **fpptr; fpptr 是個, 它可以存放 float 型態指標變數的位址 int a[6]; 位址 :a = &a[0], a + k = &a[0] + k ; 內容 :a[ k ]=*( a + k ) // Ex: a[3]=*(a+3); float af[3][4]; // row=3; column=4; 3 x 4 =12 int af 3 4 float *af = af[0] 4 float af *(af+0)+0 (*af)+1 (*af)+2 (*af)+3 af + 0 af[0][0] af[0][1] af[0][2] af[0][3] af + 1 af[1][0] af[1][1] af[1][2] af[1][3] af + 2 af[2][0] af[2][1] af[2][2] af[2][3] *(af+2)+0 *(af+2)+1 *(af+2)+2 *(af+2)+3 af : 表示陣列 af 的起始位址 = 第㆒列的起始位址 = af[0][0] 的位址 af+0: 是陣列 af 第 0 列的起始位址, 也就是 af[0][0] 的位址 = & af[0][0] af+k: 是陣列 af 第 k 列的起始位址, 也就是 af[k][0] 的位址 = & af[k][0] af[0][2] = *( *(af)+2 ) = *( *af+2 ) af[1][1] = *( *(af+1)+1 ) af[2][3] = *( *(af+2)+3 ) ( Recall:&( )= 該 的位址 ;*( )= 該 所存放的值或內容 ) 1) & af[1][1] 是否等於 *(af+1) + 1? 2) af[2] 等於 af+2 還是 *(af+2)? 3) 試著寫程式, 把各個元素的位址印出來, 以瞭解其排列與表示的方法 C/C++ 程式設計 -7

8 (structure) name Score1 Score2 John Melody Casey Vivian Mary array array array 當成結構 struct Student { char name[8]; int score1; int score2; ; // ; 莫忘 (structure) C/C++ struct struct structure_name { datatype data_member1; datatype data_member2;.. ; // ; 分號不可遺漏 ex. struct Birth { int year; unsigned char month; unsigned char day; ; // example for using structure // In C++, Birth mybirth;, works. struct Birth mybirth; mybirth.year=1999; mybirth.month=mybirth.month+1; scanf("%d", &mybirth.day); /* 結構的成員也可以是結構 */ struct Person { char name[8]; struct Birth birth; ; // example for using Person struct Person Me; Me.name="RichWang"; // error!! scanf("%s", Me.name); Me.brith.year=1963; Me.birth.month=10; scanf("%d", &Me.birth.day); Q: sizeof(birth)=? C/C++ 程式設計 -8

9 struct Student { struct Person person; float score[3]; ; struct Student struct Student stu; // stu 是結構變數,C++ 可省略 struct *stuptr; // stuptr 是存放某㆒ Student 結構位址的指標 stuptr=&stu; // stuptr 指向 stu 的位址或是說 stuptr 的值就是 stu 的位址 stu.score[0]=66; *stuptr.score[1]=70; // something wrong! 注意結合的優先順序! (*stuptr).score[1]=70; // O.K. 也可以寫成 stuptr->score[1] scanf("%f", &stu.score[2]); 參看 struct1.c, struct2.c, struct3.c, structdy.c Question : 1. char name[8]; char *name; 有何差異? 2. char name[10], *pname; a) scanf( %s, name); scanf( %s, pname); 何者合適? b) name= Kitty ; pname= Kitty, 何者正確? ( strcpy(mame, Kitty ) works.) enum 的使用 : enum: C/C++ enum 例如 : 水果 :orange banana apple watermelon 顏色 :Red Yellow Blue Brown Green 方向 :North East West South enum Fruit {orange, banana, apple, watermelon; // started from zero enum Direction {North=1, East, West, South; enum Color {Red, Green, Blue, Yellow=10, Brown; enum Boolean {false, true; 參看 enum.c C/C++ 程式設計 -9

10 1) auto (stack) ( ) 2) register auto 3) static ( ) 4) extern Link * (prototype) * * 1) 2) extern (global) 3) extern /* the program demos static variable */ #include "stdio.h" #include "conio.h" void CallStatic() { static int called=0; // look out "static" called++; printf("callstatic: I have been called %d times\n", called); void CallNormal() { int called=0; called++; printf("callnormal: I have been called %d times\n", called); void main() { int k; for (k=0; k<3; k++) CallStatic(); for (k=0; k<3; k++) CallNormal(); C/C++ 程式設計 -10

11 #define 的使用 : #define: 是種取代的作用 #define integer int // 自定資料型態 #define MAX 10 // 定義常數 #define Square(x) x*x // 定義函數 #define Square1(x) (x)*(x) // 注意與 Square 之差別 #define HighByte(x) ((x)>>8) & 0xFF #define Max(a,b) ((a)>(b))? (a) : (b) #define TurboC // 作為條件編譯時的識別字 // example for using #define : 1 #include "stdio.h" #include "conio.h" #define WORD unsigned int #define integer int // 自定資料型態 #define MAX 10 // 定義常數 #define Square(x) x*x // 定義函數 #define Square1(x) (x)*(x) // 注意與 Square 之差別 #define HighByte(x) ((x)>>8) & 0xFF #define Max(a,b) ((a)>(b))? (a) : (b) #define TurboC // 作為條件編譯時的識別字 void main() { unsigned int word=0x12ab; 條件編譯 #ifdef TurboC printf("sizeof(word)=%d\n", sizeof(word)); printf("sizeof(integer)=%d\n", sizeof(integer)); printf("max=%d\n", MAX); printf("square (1+2)=%d\n", Square (1+2)); printf("square1(1+2)=%d\n", Square1(1+2)); printf("high byte of %4x : %2x\n", word, HighByte(word)); printf("max(12, 33)=%d\n", Max(12, 33)); #endif C/C++ 程式設計 -11

12 union 的使用 : union: union union ThreeType { char ch; int i; float f; ; Q:sizeof(ThreeType)=? // example for using union : 1 #include "stdio.h" #include "conio.h" union TwoType { unsigned char ch; unsigned int i; ; TwoType twotype; twotype.i=0x1234; printf("twotype=%4x\n",twotype.i); twotype.ch=0xab; printf("twotype=%4x\n",twotype.i); Intel style : 資料儲存高高低低 union TwoType { unsigned char ch; unsigned int i; ; void main() { union TwoType twotype; // It s available in C++, TwoType twotype; printf("sizeof(twotype)=%d\n", sizeof(twotype)); twotype.i=0x1234; printf("twotype=%4x\n",twotype.i); twotype.ch=0xab; printf("twotype=%4x\n",twotype.i); twotype.i=0x4321; printf("twotype.ch=%4x\n", twotype.ch); C/C++ 程式設計 -12

13 typedef: 提供㆒種藉由類似變數宣告的方式, 來建立新的資料型態 ( 可以具有相當的複雜度 ) typedef: typedef float Vector[3]; // Vector: 表示具有㆔個 float 元素的㆒維陣列 float myvector[3]; Vector myvector; // 述兩種宣告, 具相同的效果 typedef int *IntPtr; IntPtr: 表示整數指標的資料型態 int *iptr; IntPtr iptr; // 述兩種宣告, 具相同的效果 typedef struct { char *name; int age; float weight; Person; Person: 表示包含 name,age,weight ㆔項資料成員的結構 讀取命令列的參數 : 若存在㆒可執行檔 :c:\result.exe, 可處理命令列的參數 C:\>Result argv[0] argv[1] argv[2] argv[3] 執行檔名稱 命令列參數 1 命令列參數 2 命令列參數 3 argc=4 * 程式可透過 列宣告, 來取得命令列參數 : void main(int argc, char **argv) #include "conio.h" #include "stdio.h" // >argmain xx yy // argc=3 // argv[0]="argmain", argv[1]="xx", argv[2]="yy" void main(int argc, char **argv) { printf("argc=%d\n", argc); C/C++ 程式設計 -13

14 宣告的方式 : void * malloc(size_t size); 1) size: 所需要的記憶體空間, 單位是 byte 2) 系統會在成功配置記憶體後, 傳回該記憶體區塊的起始位址 這時我們要 配合的做型態的轉換 (casting), 如此㆒來, 才可以透過指標的方式, 來對這 塊記憶體做存取 3) 當系統沒有足夠的記憶體空間時,malloc() 將傳回 NULL 於是我們可能就 需要結束程式, 並設法調整系統執行 的其他程式, 以便能空出足夠程式 執行的記憶體空間 4) 在動態記憶體配置的過程, 最好能在使用告㆒段落後, 便把該記憶體區 塊釋放,! 如果又需要配置計記憶體時, 再重新呼 叫 malloc() 即可 記憶體區塊釋放可用 free() Ex. int *iptr; // :iptr float *fptr; // :fptr iptr=(int *) malloc( 10*sizeof(int) ); // 要求配置儲存 10 個的 int 記憶體空間 fptr=(float *) malloc( 20 ); // do something here free(iptr); // 釋放配置的記憶體空間 free(fptr); // 釋放配置的記憶體空間 // C++ style iptr= new int [10]; fptr= new float [5]; // do something here delete [] iptr; delete [] fptr; // 要求配置儲存 5 (=20/4) 個的 float 記憶體空間 P.S.:(malloc() 與 free()); (new and delete)! C/C++ 程式設計 -14

15 #include "conio.h" #include "stdio.h" #include "stdlib.h" // for exit() // >result xx operator yy // argc=4 // argv[0]="...\result.exe", argv[1]="xx", argv[2]=operator, argv[3]="yy" // argv[0] : the executive program name include path void main(int argc, char **argv) { int k; char ch; float x, y, result; if ( argc!=4 ) { printf("\usage: result arg1 operator arg2\n"); printf("[ operator : +, -, *, / ]\n"); exit(0); // exit the program! ch=argv[2][0]; x=atof(argv[1]); y=atof(argv[3]); switch( ch ) { case '+' : result= x+y; break; case '-' : result= x-y; break; case '*' : result= x*y; break; case '/' : result= x/y; break; default : printf("this operator \"%s\" isn't available now!\n",argv[2]); exit(1); printf("result : %f\n", result); C/C++ 程式設計 -15

16 1) ASCII code 2) Scan code getch() ASCII code getch() getch() scan code #include "stdio.h" #include "conio.h" #define ESC 27 void main() { char ch; clrscr(); printf("===== Read pressing key program =====\n"); do { printf("press ESC to exit!\n"); ch=getch(); if ( ch==0 ) // special key pressed, ASCII value is 0 { ch=getch(); // get the scan code printf("00 %c \n",ch); else printf(" %c \n",ch); while( ch!=esc ); C/C++ 程式設計 -16

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++ - 文件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

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 料, 數, - 列 串 理 列 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

WWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2

WWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2 WWW PHP 2003 1 Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2 Comments PHP Shell Style: # C++ Style: // C Style: /* */ $value = $p * exp($r * $t); # $value

More information

Microsoft PowerPoint - C_Structure.ppt

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

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

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

CHAPTER VC#

CHAPTER VC# 1. 2. 3. 4. CHAPTER 2-1 2-2 2-3 2-4 VC# 2-5 2-6 2-7 2-8 Visual C# 2008 2-1 Visual C# 0~100 (-32768~+32767) 2 4 VC# (Overflow) 2-1 2-2 2-1 2-1.1 2-1 1 10 10!(1 10) 2-3 Visual C# 2008 10! 32767 short( )

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

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

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

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

FY.DOC

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

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++入門編 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

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

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

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

新版 明解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言語 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言語入門編『索引』 !... 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

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

( 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

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

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

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

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 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

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

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

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

C

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

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

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

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

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

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

More information

untitled

untitled 1 1.1 1.2 1.3 1.4 1.5 ++ 1.6 ++ 2 BNF 3 4 5 6 7 8 1.2 9 1.2 IF ELSE 10 1.2 11 1.2 12 1.3 Ada, Modula-2 Simula Smalltalk-80 C++, Objected Pascal(Delphi), Java, C#, VB.NET C++: C OOPL Java: C++ OOPL C# C++

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

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows

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

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

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

碩命題橫式

碩命題橫式 一 解釋名詞 :(50%) 1. Two s complement of an integer in binary 2. Arithmetic right shift of a signed integer 3. Pipelining in instruction execution 4. Highest and lowest layers in the TCP/IP protocol suite

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

untitled

untitled 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-1-1 C int main(void){ int x,y,z; int sum=0; double avg=0.0; scanf("%d",&x) ; scanf("%d",&y) ; scanf("%d",&z) ; sum=x+y+z ; avg=sum/3.0; printf("%f\n",avg); system("pause");

More information

数据结构与算法 - Python基础

数据结构与算法 - Python基础 Python 教材及课件 课件及作业见网址 xpzhang.me 1 1. Python 2. 3. (list) (tuple) 4. (dict) (set) 5. 6. 7. 2 Python Python 3 Python 4 Python 1, 100, -8080, 0,... 0x 0-9, a-f 0 xff00, 0 xa432bf 5 1.24, 3.14, -9.80,...

More information

新・解きながら学ぶJava

新・解きながら学ぶJava 481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --

More information

ebook14-4

ebook14-4 4 TINY LL(1) First F o l l o w t o p - d o w n 3 3. 3 backtracking parser predictive parser recursive-descent parsing L L ( 1 ) LL(1) parsing L L ( 1 ) L L ( 1 ) 1 L 2 L 1 L L ( k ) k L L ( 1 ) F i r s

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

untitled

untitled 1 5 IBM Intel 1. IBM 第 1/175 页 第 2/175 页 第 3/175 页 80 第 4/175 页 2. IBM 第 5/175 页 3. (1) 第 6/175 页 第 7/175 页 第 8/175 页 = = 第 9/175 页 = = = = = 第 10/175 页 = = = = = = = = 3. (2) 第 11/175 页 第 12/175 页 第 13/175

More information

WWW PHP

WWW PHP WWW PHP 2003 1 2 function function_name (parameter 1, parameter 2, parameter n ) statement list function_name sin, Sin, SIN parameter 1, parameter 2, parameter n 0 1 1 PHP HTML 3 function strcat ($left,

More information

Microsoft PowerPoint - ds-1.ppt [兼容模式]

Microsoft PowerPoint - ds-1.ppt [兼容模式] http://jwc..edu.cn/jxgl/ HomePage/Default.asp 2 说 明 总 学 时 : 72( 学 时 )= 56( 课 时 )+ 16( 实 验 ) 行 课 时 间 : 第 1 ~14 周 周 学 时 : 平 均 每 周 4 学 时 上 机 安 排 待 定 考 试 时 间 : 课 程 束 第 8 11 12 章 的 内 容 为 自 学 内 容 ; 目 录 中 标 有

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 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

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

第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

ebook50-15

ebook50-15 15 82 C / C + + Developer Studio M F C C C + + 83 C / C + + M F C D L L D L L 84 M F C MFC DLL M F C 85 MFC DLL 15.1 82 C/C++ C C + + D L L M F C M F C 84 Developer Studio S t u d i o 292 C _ c p l u s

More information

Microsoft PowerPoint - 04-array_pointer.ppt

Microsoft PowerPoint - 04-array_pointer.ppt Array 與 Pointer Array Dynamical Memory Allocation Array( 陣列 ) 陣列是用來存放同樣型態的資料陣列的大小必須在程式中預先設定在程式執行中, 陣列的大小無法改變陣列中的資料是透過索引 (index) 來存取 一維陣列的宣告 type array_name[array_size]; int iarray[100]; /* an integer array

More information

C语言的应用.PDF

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

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

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

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

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 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

untitled

untitled CHAPTER 02 2 CHAPTER 2-1 2-4 2-2 2-5 2-3 2-6 2-1 2-1-1 2-2 02 int A[3] = {10, 20, 30; A[0] 10 A[1] 20 A[2] 30 int *pa[3], A[3]; C 3 pa pa[0]pa[1]pa[2] 3 A A[0]A[1]A[2] 3 A A[0] A + i A[i] A + i &A[i]*(A

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

BC04 Module_antenna__ doc

BC04 Module_antenna__ doc http://www.infobluetooth.com TEL:+86-23-68798999 Fax: +86-23-68889515 Page 1 of 10 http://www.infobluetooth.com TEL:+86-23-68798999 Fax: +86-23-68889515 Page 2 of 10 http://www.infobluetooth.com TEL:+86-23-68798999

More information

提纲 1 2 OS Examples for 3

提纲 1 2 OS Examples for 3 第 4 章 Threads2( 线程 2) 中国科学技术大学计算机学院 October 28, 2009 提纲 1 2 OS Examples for 3 Outline 1 2 OS Examples for 3 Windows XP Threads I An Windows XP application runs as a seperate process, and each process may

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

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

Computer Architecture

Computer Architecture ECE 3120 Computer Systems Assembly Programming Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Prev: Basic computer concepts

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

Microsoft PowerPoint - Lecture7II.ppt

Microsoft PowerPoint - Lecture7II.ppt Lecture 8II SUDOKU PUZZLE SUDOKU New Play Check 軟體實作與計算實驗 1 4x4 Sudoku row column 3 2 } 4 } block 1 4 軟體實作與計算實驗 2 Sudoku Puzzle Numbers in the puzzle belong {1,2,3,4} Constraints Each column must contain

More information

chap07.key

chap07.key #include void two(); void three(); int main() printf("i'm in main.\n"); two(); return 0; void two() printf("i'm in two.\n"); three(); void three() printf("i'm in three.\n"); void, int 标识符逗号分隔,

More information

ENGG1410-F Tutorial 6

ENGG1410-F Tutorial 6 Jianwen Zhao Department of Computer Science and Engineering The Chinese University of Hong Kong 1/16 Problem 1. Matrix Diagonalization Diagonalize the following matrix: A = [ ] 1 2 4 3 2/16 Solution The

More information

Microsoft Word - About_C_PointerAdvanced.doc

Microsoft Word - About_C_PointerAdvanced.doc (*) 如何宣告或解讀某一個資料型態的指標變數? 在變數名稱前加上一個 * 號 ( 陣列也可算成是指標只是其值不能被更改!) 反過來在解讀變數的型態時 : 先找到變數名稱, 再看其左邊是否有星號 ( 至多取一個 ), 若有表示這是一個指標變數, 否則就是一般的變數 至於資料型態的部份, 只要將變數或連同 * 號移去後, 剩下的部份就是此變數或指標的資料型態 (*) 優先順序 : 運算子的優先順序 5

More information

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2 PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

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

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 範 例 試 題 (C++) 試 題 編 號 :11900-920201-4 審 定 日 期 : 94 年 7 月 1 日 修 訂 日 期 : 96 年 2 月 1 日 97 年 1 月 30 日 ( 第 二 部 份 ) 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 應 檢 參 考 資 料 壹 試

More information

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

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

More information

Chapter 1 What is Programing Paradigm 1

Chapter 1 What is Programing Paradigm 1 An Introduction to Programing Paradigm Chase Zhang May 8, 2013 Chapter 1 What is Programing Paradigm 1 CHAPTER 1. WHAT IS PROGRAMING PARADIGM 2 Definition from Wikipedia 1. Object-oriented programming/

More information

Excel VBA Excel Visual Basic for Application

Excel VBA  Excel Visual Basic for Application Excel VBA Jun5,00 Sub 分頁 () Dim i As Integer Dim Cname As String Dim Code As Variant Set score=thisworkbook.sheets("sheet") Code=Array(" 專北一 "," 專北二 "," 專北三 "," 專桃園 "," 專桃竹 "," 專中苗 ", " 專台中 "," 專台南 ","

More information

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - ch6 [相容模式] UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

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

More information

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

四川省普通高等学校

四川省普通高等学校 四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9

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

untitled

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

More information

Business Objects 5.1 Windows BusinessObjects 1

Business Objects 5.1 Windows BusinessObjects 1 Business Objects 5.1 Windows BusinessObjects 1 BusinessObjects 2 BusinessObjects BusinessObjects BusinessObjects Windows95/98/NT BusinessObjects Windows BusinessObjects BusinessObjects BusinessObjects

More information

Knowledge and its Place in Nature by Hilary Kornblith

Knowledge and its Place in Nature by Hilary Kornblith Deduction by Daniel Bonevac Chapter 7 Quantified Natural Deduction Quantified Natural Deduction As with truth trees, natural deduction in Q depends on the addition of some new rules to handle the quantifiers.

More information

Microsoft PowerPoint - STU_C_Lang_CH13.ppt

Microsoft PowerPoint - STU_C_Lang_CH13.ppt 第 13 章 動態配置記憶體 程式設計與生活 - 使用 C 語言 Shi-Huang Chen Spring 2013 第 13 章 動態配置記憶體 13-1 記憶體配置函式 malloc( ) 13-2 動態配置結構陣列 配置記憶體 預估需求數量的範圍是一項不容易的學問 例 : 大到預估今年國家預算, 小到預估櫥窗裡展示的毛線衣, 需要多少磅毛線才能織成 撰寫程式時, 一樣無法預估程式執行所需的記憶體空間

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

More information

PowerPoint Presentation

PowerPoint Presentation TOEFL Practice Online User Guide Revised September 2009 In This Guide General Tips for Using TOEFL Practice Online Directions for New Users Directions for Returning Users 2 General Tips To use TOEFL Practice

More information

穨control.PDF

穨control.PDF TCP congestion control yhmiu Outline Congestion control algorithms Purpose of RFC2581 Purpose of RFC2582 TCP SS-DR 1998 TCP Extensions RFC1072 1988 SACK RFC2018 1996 FACK 1996 Rate-Halving 1997 OldTahoe

More information

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS C H P T E R 7 Windows Vista Windows Vista Windows VistaFT16 FT32NTFS NTFSNew Technology File System NTFS 247 6 7-1 Windows VistaTransactional NTFS TxFTxF Windows Vista MicrosoftTxF CIDatomicity - Consistency

More information