02

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

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

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

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

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

Eclipse C C++, or

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

IO

FY.DOC

新版 明解C++入門編

c_cpp

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

第3章.doc

Microsoft Word - CPE考生使用手冊 docx

2.1 n ~á CPU q ˆ ~ µƒã î ˆ C++ à nù eô 1. (edit) 2. Í (preprocess) 3. (compile) 4. (link) 5. (load) 6. ˆ (execute) µl ô Ãs nù (editor) Í (preprocessor

1 C++ 2 Bjarne Stroustrup C++ (system programming) 6 (infrastructure) C++ 7 Herb Sutter 8 C++ (efficiency) (flexibility) 9 (abstraction) (productivity

Microsoft Word 電腦軟體設計.doc

提问袁小兵:

ebook50-15

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

C/C++ - 文件IO

ebook8-30

CC213

untitled

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

CC213



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

3.1 num = 3 ch = 'C' 2

untitled

C++ 程序设计 告别 OJ2 - 参考答案 MASTER 2019 年 5 月 3 日 1

Microsoft PowerPoint - string_kruse [兼容模式]

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

Microsoft Word cppFinalSolution.doc

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

untitled

untitled

Microsoft PowerPoint - 10 模板 Template.pptx

ebook39-5

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

CH01.indd

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

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

C++ 程序设计 OJ2 - 参考答案 MASTER 2019 年 5 月 3 日 1

W. Richard Stevens UNIX Sockets API echo Sockets TCP OOB IO C struct C/C++ UNIX fork() select(2)/poll(2)/epoll(4) IO IO CPU 100% libevent UNIX CPU IO

Learning Java

Microsoft Word - CPE會議紀錄151022

C/C++ - 函数

Microsoft Word - ch04三校.doc

epub83-1

C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1

D C 93 2

untitled

untitled

EK-STM32F

Microsoft Word - 第3章.doc

2/80 2

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

保母人員丙級應檢資料第二部份 doc

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

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

投影片 1


中華民國 第51屆中小學科學展覽會

範本檔


Microsoft Word - 11.doc

WWW PHP

Open topic Bellman-Ford算法与负环

(京)新登字063号

untitled

ebook15-2

Microsoft Word - 01.DOC

untitled

新・解きながら学ぶJava

迅速在两个含有大量数据的文件中寻找相同的数据

CHAPTER VC#

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

Perl

Java 1 Java String Date

mvc

Java

, 即 使 是 在 昏 暗 的 灯 光 下, 她 仍 然 可 以 那 么 耀 眼 我 没 有 地 方 去, 你 会 带 着 我 么 杜 晗 像 是 在 嘲 笑 一 般, 嘴 角 的 一 抹 冷 笑 有 着 不 适 合 这 个 年 龄 的 冷 酷 和 无 情, 看 着 江 华 的 眼 神 毫 无 温


, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

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

言1.PDF

2/14 Buffer I12, /* x=2, buffer = I 1 2 */ Buffer I243, /* x=34, buffer = I 2 43 */ x=56, buffer = I243 Buffer I243I265 code_int(int x, char *buffer)

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

Microsoft Word 養生與保健_中山大學_講義


萬里社區老人健康照護手冊

Microsoft Word - 強制汽車責任保險承保及理賠作業處理辦法 doc

Microsoft Word - 06.Understanding of Pregnancy and Birth.doc

(➂)11. 炎 炎 夏 日, 即 使 下 起 滂 沱 大 雨, 都 消 除 不 了 令 人 心 煩 的 暑 氣 這 句 話 主 要 想 表 達 什 麼? ➀ 夏 日 裡 經 常 下 著 滂 沱 大 雨, 令 人 心 煩 ➁ 下 著 滂 沱 大 雨 的 日 子, 可 以 消 除 暑 氣 ➂ 夏 日

範本檔

附 件 一 : 办 理 集 中 式 银 期 转 账 业 务 网 点 名 单 序 号 地 区 网 点 名 称 地 址 联 系 人 电 话 23 工 商 银 行 安 徽 省 铜 陵 百 大 支 行 铜 陵 市 长 江 东 路 50 号 鲁 桂 珍 工 商 银 行 安 徽

2. 二 年 級 吳 毓 秀 老 師 : 感 謝 午 餐 公 司 平 時 均 能 準 時 送 餐, 但 希 望 能 不 要 使 用 加 工 品, 且 學 生 反 映 希 望 能 多 加 蛋 品 的 食 物 3. 三 年 級 柯 阿 青 老 師 : 雞 肉 有 血 水 味, 請 午 餐 公 司 能 調

Transcription:

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

39 2.1.2 C linker sep library source-level debugger in-memory compilation RAM 2.1.3 C/C++ preprocessor C++ A+B A + B global optimizer code generator,.o.obj peephole optimizer object Python

40 1 C++ object goal linker librarian 2.1.3.1 type checking static type checking Java dynamic type checking C++ C++ C++ C C++ 2.2 C/C++ C C++ function argument return value C C++ declaration 2.2.1 declaration definition C/C++

41 : C C++ ODR one-definition rule, int x 2.2.1.1 C/C++ func1( ) C/C++ int int C/C++ a func1( ) C/C++ func1( ) a func1( ) 2.2.1.2 C C++C C++ 2.2.1.3 func1( )

42 1 C++ 2.2.1.4 X a a C/C++ extern extern extern func1( ) extern C extern extern

43 C C++ 2.2.1.5 C/C++ header file.h headerfile.h.hxx.hpp #include #include#include C++ include iostream iostream include include 2.2.1.6 C++ include C++ 8 iostream.h C.h C++

44 1 C++ c : C C++.h 2.2.2.o C++ C++ 2.2.3 1) 2) 3) C/C+ 2.2.3.1 C C++

bug C++ 2.2.3.2 C/C++ C/C++ C++ iostream <iostream> 2.2.3.3 C C++ C C C++ C++ C C++ POSIX POSIX UNIX C++ UNIX Linux POSIX DOS/Windows POSIX POSIX 2.3 C++ C++ iostream iostream 2.3.1 iostream iostream iostream cout 45 Perl Python www.perl.org www.python.org

46 1 C++ << C C++ iostream << howdy! cout cout console output 12 2.3.2 1 C C++ namespace C++ using C++ ( standard ) using std using using <iostream>.h, <iostream.h>

47.h using 10 2.3.3 C/C++ main( ) C++ C++ main( ) in C/C++ C++ C/* */C++ C //// /* */ // 2.3.4 Hello, World! <<cout endl C stringc++ string

48 1 C++ character array ASCII 0 \ \n C \t ( ) \\ \b ( ) coutcout << cout /:~ 2 www.bruceeckel.com www.bruceeckel.com 2.3.5 CO2 Hello.cpp GNU C++ Internet 2.4 iostream

49 cast, char ( char ) ASC char(27) escape cout 2.4.1 C character array concatenation C/C++ 2.4.2 cin console input cin cin >>

50 1 C++ 2.4.3 Unix DOS shell C system( ) C/C++ system( ) <cstdlib> system( ) C++ C C C C++ C++ 2.5 C++string C C string string string C++ <string> stringstd using string

s1 s2 s3 s4 string string = string = string string + + string string string += string cout stringstring s1+s2+"!" 2.6 C C++ iostream C <fstream> <fstream> <iostream> cin cout <iostream> ifstream cin ofstreamcout iostream iostream getline( ) string getline( ) ifstream stream string ifstream ofstream while while 51 getline( ) 2 iostreams

52 1 C++ while getline(in,s) true while getline( ) true false while getline( ) getline( ) string string string string 2.7 vector string string string string string string C++ container C++ C++ STL, Standard Template 1994 Library Alex Stepanov San Diego C++ C++ Alex Stepanov

C++ STL C++ SGI ( http://www.sgi.com/technology/stl) STL SGI STL C++ C++ STL C++ SGI STL C++ STL C++ 2 vector vector 2 vector vector C++ vector template Shape vector Cat vector String vector, vector string vector vector<string> stri vectorvector vector vector push_back( ) (. ) push_back( ) put insert( ) 2 push_front( ) ( vector) vector vector C++ push_back( ) vector vector vector indexing n 5 a[4]0 << >> iostreams vector [ ] vector vector vector <vector> 53

54 1 C++ string string vector v whilev whilefor while for while for int i=0 i 0 i vector v size( ) C/C++ i 1i++ i 1 i for i 0 vector 1i cout i cout endl iostreams>>

55 false vector vector<int> vector vector vector vector 2.8 C++ string vector www.bruceeckel.com www.dinkumware.com 2

56 1 C++ C C 3 2.9 Thinking in C++ Annotated Solution Guide http://www.bruceeckel.com 2-1 Hello.cpp 2-2 Stream2.cpp Numconv.cpp * 2-3 2-4 string== 2-5 Fillvector.cpp 2-6 Fillvector.cpp vector 2-7 2-8 vector<float> for 25 vector 2-9 vector<float> 8 for vector vector 2-10 vector<float> 25 vectorvector