1001 1002 1003 1004 1005 1006 1007 1008
- Slides: 24
ポインタイメージ 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 番地 番地 int a; 番地 番地 long x; 番地 番地 番地 char str[5]; n &aは 1001 n &xは 1003 n &str[0]は 1007( str だけでも1007) n &str[2]は 1009 n a と *(&a)は同じ 番地 番地
答え 実行結果 30 #include <stdio. h> void main (void){ int a, b=10, c=20; int *pa, *pb, *pc; pa=&a; pb=&b; pc=&c; *pa = *pb + *pc; printf(“%d n”, *pa); }
ファイルの入出力 2 実際にファイルを扱うときにはこのような処理をします。 #include <stdio. h> #include <windows. h> int main(void){ FILE *fp; int c; //char(0 -255)はEOF(-1)が表現できないため不可 fp = fopen(“test. txt”, ”r”); if(fp == NULL){ printf(“No File”); return 2; } while(1){ c = fgetc(fp); //fgetc関数のは呼ばれるごとにファイルの中身を 1 Byteづつ返します if(c == EOF){printf(“End Of File”); break; } printf(“%c”, c); } fclose(fp); system(“pause”); }
色付け関数 /* w. Attributes 0 x. AB 16進数 2桁の変数(= 0 -255の変数) B:文字色 0黒、1暗青、2暗緑、3暗水、4暗赤、5暗紫、6暗黄、7白 8灰 、9青、a緑 b水 c赤 d紫 e黄 f輝白 A:背景色 */ #include <windows. h> #include <stdio. h> void main(){ HANDLE h. Stdout; WORD w. Attributes; CONSOLE_SCREEN_BUFFER_INFO csbi; h. Stdout = Get. Std. Handle(STD_OUTPUT_HANDLE); Get. Console. Screen. Buffer. Info(h. Stdout, &csbi); //ここまでは呪文 w. Attributes = 0 x 6 C; //0 xは 16進数で書くよという合図 108と十進数で書いてもOK Set. Console. Text. Attribute(h. Stdout, w. Attributes); //この 2行は色指定 printf("hello, ", w. Attributes); w. Attributes = 0 x 3 e; Set. Console. Text. Attribute(h. Stdout, w. Attributes); printf("world!nn", w. Attributes); }
スクリプト、マクロの勧め2 n 秀丸(txtへのマクロ) while(lineno < linecount 2 ){//現在の行 < 最後の行 golineend; insert “<BR>” ; down; } golineend; insert”<BR>” n UWSC(windowsへのマクロ) while true kbd(VK_F 5, 0)//kbd(キー, 待機ミリ秒) wend
- 1001 1002 1003 1004
- 1002 üssü 0
- Pengertian pemrograman terstruktur
- Informe técnico nº 1819-2018-servir-gpgsc
- Tia 1005
- Sff-ta-1008
- 768-1007-1-nd
- Opex cap 1008
- Stanag 1008 edition 9
- 1004/5375
- Mips 1004 kec
- Elif capítulo 1002
- Tübitak 1002 ne kadar sürede sonuçlanır
- Spectrum ilc 1002
- Oberon cisco
- Decree professionalizing teaching (pd 1006)
- Eg 1003
- Eg 1003
- His 1003
- Eg 1003
- Eg 1003
- Fig 1003
- Lss-1003
- Cisc 1003
- Eg 1003