1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l
|
|
|
- そうすけ ことじ
- 9 years ago
- Views:
Transcription
1 C/C C STL(1) stdio sizeof new delete void
2 1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector libc STL C/C++ *1 OS/ *2 *1 *2 2
3 1.2 stdio stdio STanDard Input/Output *3 cstdio stdio.h stdio fopen fclose fread fwrite fseek ftell feof fgets fgetc fputs fputc printf fprintf sprintf scanf fscanf sscanf stdio stdio read.cpp 1 #i n c l u d e <c s t d i o > / s t d i o. h / 2 #i n c l u d e <iostream > 3 4 using namespace std ; *3 3
4 5 6 #d e f i n e READ FILE s t d i o r e a d. cpp 7 #d e f i n e SIZE BUFFER i n t main ( void ) 11 { 12 FILE fp ; // 13 char buf [ SIZE BUFFER ] ; // fp = fopen (READ FILE, rb ) ; // R e a d i f ( fp==null) { // fopen ( ) NULL 18 cout << can t open the f i l e READ FILE << endl ; 19 return 1 ; 20 } while (! f e o f ( fp ) ) { // EOF(End Of F i l e ) 23 i n t s i z e ; // // b u f 26 s i z e = f r e a d ( buf, 1, SIZE BUFFER 1, fp ) ; 27 buf [ s i z e ] = \0 ; // 28 cout << buf ; // 29 } f c l o s e ( fp ) ; // 32 return 0 ; 33 } fopen() FILE 2 b rb 4
5 r w a r+ w+ a+ 0 0 *4 feof() FILE EOF : End Of File 0 0 fopen / feof() clearerr() fread() EOF fclose() 1 stdio write.cpp 1 #i n c l u d e <c s t d i o > / s t d i o. h / 2 #i n c l u d e <iostream > 3 4 using namespace std ; 5 6 #d e f i n e WRITE FILE hoge. txt 7 #d e f i n e SIZE BUFFER i n t main ( void ) *4 b 5
6 11 { 12 FILE fp ; // 13 char buf [ SIZE BUFFER ] ; // 14 char c ; fp = fopen (WRITE FILE, w+b ) ; // Read/ W r i t e i f ( fp==null) { // fopen ( ) NULL 19 cout << can t open the f i l e WRITE FILE << endl ; 20 return 1 ; 21 } // 24 f w r i t e ( hogehoge \ r \n,1, 10, fp ) ; // \ r \ n (CRLF) f s e e k ( fp, 0,SEEK SET ) ; // 27 f g e t s ( buf, SIZE BUFFER, fp ) ; // // 30 f p u t s ( \n, fp ) ; // \ n (LF) // f o r ( i n t i =0; buf [ i ]!= \0 ; i++) 34 fputc ( buf [ i ], fp ) ; // f s e e k ( fp, 0,SEEK SET ) ; // 37 // 1 38 f o r ( i n t i =0; ( c = f g e t c ( fp ) )!= EOF; i++) 39 buf [ i ] = c ; // f t e l l ( ) 42 buf [ f t e l l ( fp ) ] = \0 ; // cout << buf ; 45 6
7 46 f c l o s e ( fp ) ; 47 } fwrite() fread() fseek() 3 SEEK SET SEEK CUR SEEK END 2 *5 fseek(fp,0,seek SET) fseek(fp,10,seek END) 10 fgets() EOF fgets() 1 NULL fputs() fputc() fgetc() 1 unsigned char int EOF ftell() C printf scanf cin/cout formatio.cpp 1 #i n c l u d e <c s t d i o > / s t d i o. h / 2 3 using namespace std ; 4 5 #d e f i n e RW FILE hoge. txt 6 #d e f i n e SIZE BUFFER 256 *5 offset 7
8 7 8 i n t main ( void ) 9 { 10 FILE fp ; 11 char buf [ SIZE BUFFER ] ; 12 i n t i ; 13 unsigned u ; p r i n t f ( h e l l o, world \n ) ; // p r i n t f ( \n ) ; 18 s c a n f ( %s, buf ) ; // %s // %s 21 p r i n t f ( %s \n, buf ) ; // %d 1 0 d i g i t 24 p r i n t f ( \n ) ; 25 s c a n f ( %d,& i ) ; 26 p r i n t f ( %d \n, i ) ; u = i ; 29 p r i n t f ( 8 %o\n, u ) ; // %o 8 30 p r i n t f ( 16 %04x\n, u ) ; // %x // fp = fopen (RW FILE, a+b ) ; 34 i f ( fp==null) { // fopen ( ) NULL 35 p r i n t f ( can t open the f i l e RW FILE \n ) ; 36 return 1 ; 37 } 38 f s c a n f ( fp, %s \n, buf ) ; 39 f p r i n t f ( fp, %s \n%i \n%x\n, buf, i, u ) ; 40 f c l o s e ( fp ) ; 41 } 8
9 %c 1 %g double %p OS stdio OS stdio fclose() fflush() C 3 stdin stdout stderr 3 fopen() stdio FILE* printf( ) fprintf(stdout, ) STL cin cout stdin stdout stderr cerr cin/cout stdin/stdout cin/cout stdin/stdout cout/stdout cin/stdin 9
10 std::sync with stdio() cin/cout stdin/stdout C stdio STL iostream cin/cout fopen() stdio.h cstdio C C++ stdio.h cstdio stdlib.h cstdlib c.h C++ include libc (cname) std (NAME.h) *6 C C++ include C++ include Google 3 *7 strcpy+c C + + C + + Google Unix OS Cygwin Manpage man fopen fopen() man stdio Linux Manpage OS C Linux Windows *6 cstdio std using *7 10
11 2 2.1 sizeof sizeof sizeof.cpp 1 #i n c l u d e <iostream > 2 3 using namespace std ; i n t main ( void ) 7 { 8 i n t i n t e g e r ; 9 i n t array [ ] = {9, 8, 7, 6, 5, 4, 3 }; 10 s t r u c t S { 11 char c ; 12 i n t i ; 13 double d ; 14 } ; / / 17 cout << char / i n t / s t r u c t S << endl ; 18 cout << s i z e o f ( char ) << / << s i z e o f ( i n t ) << / 19 << s i z e o f ( s t r u c t S) << endl ; cout << char / i n t / s t r u c t S << endl ; 22 cout << s i z e o f ( char ) << / << s i z e o f ( i n t ) << / 23 << s i z e o f ( s t r u c t S ) << endl ; cout << i n t e g e r : << s i z e o f i n t e g e r << endl ; 26 cout << array : << s i z e o f array << endl ; 27 11
12 28 // ( / 1 ) 29 f o r ( i n t i =0; i < s i z e o f array / s i z e o f array [ 0 ] ; i++) 30 cout << array [ i ] << endl ; return 0 ; 33 } 2.2 C/C++ (auto ) static *8 C/C new delete new delete new.cpp 1 #i n c l u d e <iostream > 2 3 using namespace std ; 4 *8 C99 C++ C 1 12
13 5 6 i n t main ( void ) 7 { 8 s t r u c t S { 9 i n t i ; 10 char c [ 1 6 ] ; 11 } ; // n e w 14 ch a r pchar = new ch a r ; 15 i n t pint = new i n t ; 16 s t r u c t S ps = new s t r u c t S ; // 19 pint = 20000; 20 pchar = P ; 21 ps >i = 1 0 ; 22 ps >c [ 0 ] = a ; ps >c [ 1 ] = b ; ps >c [ 2 ] = c ; 23 ps >c [ 3 ] = d ; ps >c [ 4 ] = e ; ps >c [ 5 ] = \0 ; cout << pint << endl ; 26 cout << pchar << endl ; 27 cout << ps >i << endl ; 28 cout << ps >c << endl ; // d e l e t e 31 d e l e t e pchar ; 32 d e l e t e pint ; 33 d e l e t e ps ; return 0 ; 36 } 13
14 2.4 new delete delete[] new array.cpp 1 #i n c l u d e <iostream > 2 3 using namespace std ; i n t c r e a t e a r r a y ( i n t num) 7 { 8 i n t p = new i n t [num ] ; // new 9 10 f o r ( i n t i =0; i < num; i++) 11 p [ i ] = num i ; return p ; 14 } void d e s t r o y a r r a y ( i n t a [ ] ) 17 { 18 d e l e t e [ ] a ; // d e l e t e [ ] 19 } i n t main ( void ) 22 { 23 i n t p ; 24 i n t num; cout << << endl ; 27 c i n >> num; 14
15 28 29 p = c r e a t e a r r a y (num ) ; f o r ( i n t i =0; i < num; i++) 32 cout << p [ i ] << endl ; d e s t r o y a r r a y (p ) ; return 0 ; 37 } sizeof 2.5 new delete new delete delete new C/C++ GC Garbage Collection *9 C/C++ GC BoehmGC * void void void void * 11 *9 GC Java C# D C++ GC *10 Boehm/gc/ *11 C void C++ 15
16 void.cpp 1 #i n c l u d e <iostream > 2 3 using namespace std ; i n t main ( void ) 7 { 8 void p ; // v o i d 9 i n t pint ; 10 i n t i = 234; p = &i ; // i n t v o i d pint = ( i n t )p ; // i n t cout << pint << endl ; return 0 ; 19 } new void 16
mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )
2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test
ex14.dvi
1,, 0, b (b b 2 b ) n k n = n j b j, (0 n j b 1), n =(n k n k 1...n 1 n 0 ) b, n j j j +1, 0,...,b 1 (digit). b b, n b 1 ñ, ñ = k (b 1 n j )b j b N, n b n, n = b N n, n =ñ+1 b N, n m n + m (mod b N ),
02: 変数と標準入出力
C プログラミング入門 基幹 7 ( 水 5) 1 10: ファイル入出力 Linux にログインし 以下の講義ページを開いておくこと http://www-it.sci.waseda.ac.jp/teachers/w48369 2/CPR1/ 2016-06-15 今日の内容 2 標準ライブラリ関数によりファイルの出力を行う画像ファイルの生成を例題として 配列の作成を復習する 文字列の扱いを復習する
untitled
Q 8 1 8.1 (C++) C++ cin cout 5 C++ 16 6 p.63 8.3 #include 7 showbase noshowbase showpoint noshowpoint 8.3 uppercase 16 nouppercase 16 setfill(int) setprecision(int) setw(int) setbase(int) dec
新版明解C言語 実践編
2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,
: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology
I117 8 1 School of Information Science, Japan Advanced Institute of Science and Technology : CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and
超初心者用
3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num
新・明解C言語 実践編
第 1 章 見 21 1-1 見えないエラー 見 List 1-1 "max2x1.h" a, b max2 List 1-1 chap01/max2x1.h max2 "max2x1.h" #define max2(a, b) ((a) > (b)? (a) : (b)) max2 List 1-2 List 1-2 chap01/max2x1test.c max2 #include
3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout <<
C++ C C++ 1 C++ C++ C C++ C C++? C C++ C *.c *.cpp C cpp VC C++ 2 C++ C++ C++ [1], C++,,1999 [2],,,2001 [3], ( )( ),,2001 [4] B.W. /D.M.,, C,,1989 C Web [5], http://kumei.ne.jp/c_lang/ 3 Hello World Hello
ファイル入出力と プロセス間通信 \(1\)
ファイル入出力と プロセス間通信 (1) 2004 年 12 月 10 日 海谷治彦 1 目次 まずはマニュアルをみよう. 2 章システムコールインタフェース 3 章汎用関数定義 アンバッファー化入出力 (Unbuffered I/O) open, read, write... lseek, dup... 標準入出力ライブラリ fopen, fscanf, fprintf... 標準入力, 標準出力,
tuat2.dvi
( 2 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 7 7 ( 2 ) 1 / 54 (1) (2) (?) (1) (2) 2 ( 2 ) 2 / 54 1. 30 2. 2012 6 30 25 OS ( 2 ) 3 / 54 10 20 1993 1996 2000 2003 = 30 ( 2 ) 4 / 54 1 2 2 ( 2 ) 5 /
(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10;
(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector x; for(int i = 0; i < 10; ++i) x.push_back(i); vector STL x.push_back(i) STL
1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include
1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() malloc 2 #include #include #include enum LENGTH = 10 ; int
ファイル入出力
C プログラミング Ⅱ の基礎 とは ファイルへデータを書き込んだり ( 出力 ), ファイルからデータを読み込んだり ( 入力 ) する C 言語では キーボードからの入力 画面への出力と同じようなコードで 処理を実現できる プログラム 入力 出力 ファイル 出力 入力 2 入出力の基本 ストリーム プログラム上で様々な装置への入出力を行う機構様々な入出力装置を統一的な方法で扱うことができる ハードディスクなどではファイルデータによって入出力が行われる
web07.dvi
93 7 MATLAB Octave MATLAB Octave MAT MATLAB Octave copyright c 2004 Tatsuya Kitamura / All rights reserved. 94 7 7.1 UNIX Windows pwd Print Working Directory >> pwd ans = /home/kitamura/matlab pwd cd Change
1.ppt
/* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)
Taro-ファイル処理(公開版).jtd
ファイル処理 0. 目次 1. はじめに 2. ファイル内容の表示 3. ファイル内容の複写 3. 1 文字単位 3. 2 行単位 4. 書式付き入出力 5. 文字配列への入出力 6. 課題 6. 1 課題 1 ( ファイル圧縮 復元 ) - 1 - 1. はじめに ファイル処理プログラムの形は次のようになる #include main() { FILE *fp1,*fp2; ファイルポインタの宣言
Microsoft Word - Cプログラミング演習(10)
第 10 回 (6/25) 3. ファイルとその応用 (3) ファイルの更新 シーケンシャルファイルの更新 シーケンシャルファイルでは, 各レコードが可変長で連続して格納されており, その中の特定のレコードを変更することができない そこで一般的には, マスタファイルからデータを取り出し, 更新処理を行ったあとに新マスタファイルに書き込む 注 ) マスタファイル : 主ファイル, 基本ファイルと呼ばれるファイルで内容は比較的固定的であり,
1 CUI CUI CUI 1.1 cout cin 1.1.1 redirect.cpp #i n c l u d e <s t r i n g > 3 using namespace std ; 5 6 i n t main ( void ) 7 { 8 s t r i n g s ; 10 c
C/C++ 007 6 11 1 CUI 1.1....................................... 1................................ 3 1.3 argc argv................................. 5.1.............................................. 5...............................................
1-4 int a; std::cin >> a; std::cout << "a = " << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >>
1 C++ 1.1 C C++ C++ C C C++ 1.1.1 C printf() scanf() C++ C hello world printf() 1-1 #include printf( "hello world\n" ); C++ 1-2 std::cout
Cプログラミング1(再) 第2回
C プログラミング 1( 再 ) 第 2 回 講義では Cプログラミングの基本を学び演習では やや実践的なプログラミングを通して学ぶ 1 前回のレポートから 前回の宿題 数あてゲーム の説明において 次のように書いていたものがいた : これはコンピュータがランダムに設定した数字を人間が当てるゲームである この説明でどこかおかしなところはないだろうか? 2 コンピュータの用語と日常的な用語の違い 物理において
プログラミング演習 土曜日(Q組)
プログラミング演習 土曜日 (Q 組 ) 主なテーマ 標準入出力とファイル処理 (8 章 ) 1 ストリームの概念 8.1 標準入出力 (C++) C++ では データの入出力を ストリーム という概念で操作する ストリームはデータを入出力処理し また 入出力に伴う 状態 を設定 / 保持する 例 : 現在 ファイルの何文字目を読み書きしているか などの情報 論理デバイス 物理デバイス 入力ストリーム
program.dvi
2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation
‚æ2›ñ C„¾„ê‡Ìš|
I 8 10 10 I ( 6 ) 10 10 1 / 23 1 C ( ) getchar(), gets(), scanf() ( ) putchar(), puts(), printf() 1 getchar(), putchar() 1 I ( 6 ) 10 10 2 / 23 1 (getchar 1 1) 1 #include 2 void main(void){ 3 int
PowerPoint プレゼンテーション
プログラミング応用演習 第 3 回構造体, ファイル入出力 先週の出席確認へのコメント 暗号を破りたいが 平文の候補が多すぎる 人間の目で確認する代わりに どんなプログラムがあればよいか? 辞書を挙げた人が多かった 正しい着眼です 何億個もの平文候補が想定されるので 形態素解析や品詞判別を挙げた人もいます 辞書に近い回答で悪くはないのですが 平文候補ごとにあまり高機能なものを呼び出すと時間がかかる
untitled
C -1 - -2 - concept lecture keywords FILE, fopen, fclose, fscanf, fprintf, EOF, r w a, typedef gifts.dat Yt JZK-3 Jizake tsumeawase 45 BSP-15 Body soap set 3 BT-2 Bath towel set 25 TEA-2 Koutya
Microsoft PowerPoint - kougi2.ppt
C プログラミング演習 第 2 回 Microsoft Visual Studio.NET を使ってみよう 説明 例題 1. プログラム実行の体験 コンピュータを役に立つ道具として実感する 次ページのプログラムを使って, Microsoft Visual Studio.NETでの C++ ソースファイル編集, ビルド, テスト実行の一連の過程を体験する 例題 1 のプログラムの機能 計算の繰り返し
1.3 ( ) ( ) C
1 1.1 (Data Base) (Container) C++ Java 1.2 1 1.3 ( ) ( ) 1. 2. 3. C++ 2 2.1 2.2 2.3 2 C Fortran C++ Java 3 3.1 (Vector) 1. 2. ( ) 3.2 3 3.3 C++ C++ STL C++ (Template) vector vector< > ; int arrayint vector
untitled
II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}
新・明解C言語 ポインタ完全攻略
2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)
r08.dvi
19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev
PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU
1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf
C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1
C++ 2018 7 1, 2018 11 4 http://nalab.mind.meiji.ac.jp/~mk/labo/text/nantoka-c++/ 1 C++ C C++ C++ C cpprefjp - C++ 1 C++17 2 2 CUI 2.1 donothing.cpp 1 /* 2 * donothing.cpp 3 */ 4 5 int main() 6 7 return
Minimum C Minimum C Minimum C BNF T okenseq W hite Any D
6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet
Microsoft PowerPoint - kougi4.ppt
C の実行モデル 自由落下距離 前回の授業の 例題 1 の復習と重要事項 の確認 地上で物を落とし始めた後の自由落下距離を 求める 重力加速度 g は 9.8 とする 自由落下距離を求めるために, プログラム中に, 計算式 y = ( 9.8 / 2.0 ) * x * x を書く C++ ソースファイルの編集 編集画面 編集中のファイル名 関係するファイルなどが表示される ビルド結果などが表示される画面
cpp1.dvi
2017 c 1 C++ (1) C C++, C++, C 11, 12 13 (1) 14 (2) 11 1 n C++ //, [List 11] 1: #include // C 2: 3: int main(void) { 4: std::cout
Microsoft PowerPoint - 14th.ppt [互換モード]
工学部 6 7 8 9 10 組 ( 奇数学籍番号 ) 担当 : 長谷川英之 情報処理演習 第 14 回 2011 年 1 月 20 日 1 今日のテーマ ファイル入出力 ですが, キーボード入力などもおさらいします 2 標準入力 キーボードで入力 : 標準入力という例 )scanf( %d,&i) 前回までの講義でファイルからデータを読み込む場合に使用した関数 : fscanf 例 )fscanf(fin,
第7章 有限要素法のプログラミング
April 3, 2019 1 / 34 7.1 ( ) 2 Poisson 2 / 34 7.2 femfp.c [1] main( ) input( ) assem( ) ecm( ) f( ) solve( ) gs { solve( ) output( ) 3 / 34 7.3 fopen() #include FILE *fopen(char *fname, char
情報処理演習 B8クラス
予定スケジュール ( 全 15 回 ) 1 1. 終了 プログラミング言語の基礎 2. 終了 演算と型 3. 終了 プログラムの流れの分岐 (if 文,switch 文など ) 4. 終了 プログラムの流れの繰返し (do, while, for 文など ) 5. 終了 中間レポート1 6. 終了 配列 7. 終了 関数 8. 終了 文字列 ( 文字列の配列, 文字列の操作 ) 9. 終了 ポインタ
解きながら学ぶC++入門編
!... 38!=... 35 "... 112 " "... 311 " "... 4, 264 #... 371 #define... 126, 371 #endif... 369 #if... 369 #ifndef... 369 #include... 3, 311 #undef... 371 %... 17, 18 %=... 85 &... 222 &... 203 &&... 40 &=...
/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v
1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html [email protected] /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );
/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1
I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara [email protected] / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming
r07.dvi
19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1
: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p.
stdio considered harmful [email protected] 2005 06 02 stdio considered harmful p. : Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. : stdio stdio Nonblocking
C言語講座 ~ファイル入出力編~
C 言語講座 ~ ファイル入出力編 ~ ポインタ使います 例 2 練習問題 3 初めに プログラムを組む上での話と今回の演習について 例えばこの画面の場合 背景の動画の描写 ノーツを流れてくるようにする ボタンを押したら違反亭ライン近くのノーツは消えるようにする処理 曲の難易度ごとに判定を追加とか残りの処理 完成 演習 1 クリア 演習 2 クリア 過程は各自で考えてください 演習 3 クリア ファイルの出入力でこれからやること
ohp07.dvi
19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5
II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D
II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko
(K&R 2.9) ~, &,, >>, << 2. (K&R 5.7) 3. (K&R 5.9) 4. (K&R 5.10) (argc argv atoi(), atof() ) 5. (K&R 7.5) (K&R 7.6) - FILE, stdin, stdout, std
3 3 1. 1 (K&R.9) ~, &,, >>,
comment.dvi
( ) (sample1.c) (sample1.c) 2 2 Nearest Neighbor 1 (2D-class1.dat) 2 (2D-class2.dat) (2D-test.dat) 3 Nearest Neighbor Nearest Neighbor ( 1) 2 1: NN 1 (sample1.c) /* -----------------------------------------------------------------
ex01.dvi
,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double
Apache Web Server 2 Compaq ActiveAnswers Deskpro Compaq Insight Manager Fastart Systempro Systempro/LT ProLiant ROMPaq Qvision SmartStart NetFlex Quic
Technical Guide 1999 5 Internet and E-Commerce Solutions Business Unit Enterprise Solutions Division Apache Web Server Compaq Linux Apache HTTP Compaq Computer Corporation...3...3...4...5...6...7...7...7...8...10...10...16...16
PowerPoint Presentation
ファイルの入出力 芝浦工業大学情報工学科 青木義満 今回の講義内容 ファイル入出力 ファイルからのデータ読込み ファイルと配列 2 1 ファイルへのデータ書き込み ( 復習 ) ソースファイル名 :fileio1.c データをファイルに書き込み #include int main(void) { ファイルポインタ宣言 int student_id = 100; char name[
:30 12:00 I. I VI II. III. IV. a d V. VI
2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx
USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231
0 0.1 ANSI-C 0.2 web http://www1.doshisha.ac.jp/ kibuki/programming/resume p.html 0.3 2012 1 9/28 0 [ 01] 2 10/5 1 C 2 3 10/12 10 1 2 [ 02] 4 10/19 3 5 10/26 3 [ 03] 6 11/2 3 [ 04] 7 11/9 8 11/16 4 9 11/30
PowerPoint Presentation
p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight
