計算機程式 第七單元 Pointers and Strings 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program,

Slides:



Advertisements
Similar presentations
Operations Management Unit 8: Planning Capacity 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed., Lee J.
Advertisements

Inventory Management: Safety Inventory (II) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第七單元: Inventory Management:
Operations Management Unit 7: Managing Quality (2) 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed., Lee.
Andy Guo Planning Demand and Supply in a Supply Chain 第二單元 (3) : Planning Demand and Supply in a Supply Chain 郭瑞祥教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣.
Inventory Management: Safety Inventory ( I ) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第六單元: Inventory Management:
Operations Management Unit 11: Managing Inventories (2) 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed.,
Pricing and Revenue Management in the Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十二單元 (2) : Pricing.
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC.
新生講座 8.Reading Critically : Be a critical reader
西方文明史 第九講: 農業、商業發展 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 1.
1 Self Knowledge 自我知識 第六單元: Historical background: Locke 歷史背景 : 洛克 梁益堉 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣.
Designing the Distribution Network in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十二單元 (3) : Designing.
佛學概論 第七講:《般若經》的佛法教學 授課教師:國立臺灣大學哲學系 蔡耀明 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 1.
計算機程式 第十一單元 Operator Overloading I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to.
計算機概論 ( 上機實習部分 ) 每週上課講義 授課教師 : 吳槐桂 最後更新 : 2004/10/21.
本作品由社區天氣資訊網絡的黃文翰製作,以共享創意姓名標示 - 非商業性 - 相同方式分享 3.0 香港 授權條款釋出。如欲瀏覽本授權條款之副本,請造訪 。社區天氣資訊網絡共享創意姓名標示.
本作品由香港理工大學應用物理學系的黃文翰製作,以共享創意姓名標示 - 非商業性 - 相同方式分享 3.0 香港 授權條款釋出。如欲瀏覽本授權條款之副本,請造訪 。共享創意姓名標示.
長訊科技 EVRCOM Voice Mail System 使用者操作說明及流程. 自動總機 -- 來電語音轉接服務流程 ( 範例流程 )
Designing the Distribution Network in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十 三單元 (1) :
Inventory Management: Cycle Inventory 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第四單元: Inventory Management:
授課教師:楊宏智教授 1 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用.
Sourcing Decisions in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十一單元 : Sourcing Decisions in.
1 西方文明史 第二講: 兩河與埃及 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 劉 慧 教授.
1 Survey of Selected Western Classics Unit 8: 如何讀莎劇 授課教師 : 國立臺灣大學外國語文學系邱錦榮 教授 【本著作除另有註明外,採取創 CC 「姓名標示- 非商業性-相同方式分享」台灣 3.0 版授權釋出】創 CC 「姓名標示- 非商業性-相同方式分享」台灣.
H.-W. Sinn European Law and Life Culture 第四單元: The European Competitveness Crisis Lecturer: Hans-Werner Sinn, Ifo Institute for Economic Research Unless.
Supply Chain Coordination & Information Integration 》【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第七單元 (2) : Supply.
Andy Guo Planning Demand and Supply in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第三單元 (1) : Planning.
計算機程式 第十四單元 Polymorphism 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
Operations Management Unit 10: Managing Inventories (1) 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed.,
計算機程式 第四單元 Function I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 1 蔣明晃教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用.
計算機程式 第五單元 Function II 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
1 西方文明史 第十三講:中古歐洲學術 ─ 大學、士林哲學 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版.
Managing Transportation in a Supply Chain 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第十一單元 (2) : Managing Transportation.
計算機程式 第一單元 Introduction to Computers, the Internet and the WWW 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣.
Strategic Framework to Analyze Supply Chains 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第一單元: Strategic Framework.
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC.
1 Self Knowledge 自我知識 第十三單元: Acquaintance theories: objections and replies 親知理論的困難與回應 梁益堉 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用.
Legal and legislative crisis in EU and Asia : analysis and reform models? 【本著作除另有註明外,採取創用 CC 「姓名標 示-非商業性-相同方式分享」台灣 3.0 版授權 釋出】創用 CC 「姓名標 示-非商業性-相同方式分享」台灣.
LI & FUNG 【本著作除另有註明外,採取創用 CC 「姓名標示-非商業性-相 同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示-非商業性-相 同方式分享」台灣 3.0 版 郭瑞祥教授 第二單元: Case Study- Li & Fung Lifung group 1.
1 西方文明史 第六講: 羅馬(二) 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版.
Inventory Management: Cycle Inventory-II 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 第五單元: Inventory Management:
西方文明史 第一講: 城市與文明 1 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 劉 慧 教授.
Determining Optimal Level of Product Availability Optimal Matching of Supply and Demand (III) 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC.
Chap. 12 The Health Benefits of Recreational Activities on Leisure Farms in Taiwan (III) 張俊彥 Chun-Yen Chang 國立臺灣大學園藝學系教授 國立臺灣大學園藝暨景觀學系 【園藝療法 】 【本著作除另有註明外,採取創用.
1 由佛典選讀入手之二 巴利經典選讀 第六講:由佛典選讀入手之二 巴利經典選讀 授課教師:國立臺灣大學哲學系 蔡耀明 教授 1 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版.
計算機程式 第二單元 Control Structure I 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program,
西方文明史 第十五講: 英法百年戰爭 劉 慧 教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」臺灣 3.0 版 1.
Ch3-1. Linguistic Manifestation: Culturally-determined 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】 The “Work” under the Creative Commons Taiwan.
Operations Management Unit 9: Managing Process Constraints 授課教師: 國立臺灣大學工商管理學系 余峻瑜 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th.
第十六單元:歐盟法與生命對話 歐盟法研討會 列強權力衝突間的緩衝區政經策略 EU Conflict Management, the Strategy of Politics and Economics in “Neutral Area” within Conflict of Super Powers.
Survey of Selected Western Classics Unit 2: A Rose for Emily 授課教師 : 李欣穎副教授 【本著作除另有註明外,採取創 CC 「姓名標示- 非商業性-相同方式分享」台灣 3.0 版授權釋出】創 CC 「姓名標示- 非商業性-相同方式分享」台灣.
計算機程式 第十三單元 Inheritance 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e,
Ch15-1 Language Policy Based on Language Policy and Multiculturalism 語言政策的多元文化思考 授課老師:蘇以文 I-wen Su 【本著作除另有註明外,採取創用 CC 「姓名標示- 非商業性-相同方式分享」台灣 3.0 版授權釋出】
Ch3-2. Language and Human Migration 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】 The “Work” under the Creative Commons Taiwan 3.0 License of “BY-NC-SA”.
Creating and Negotiating Peace Structures: Difficulties for Small Nations Caught Between Superpowers Part 2: Difficulties with Economic Peace Structures.
計算機程式 第十二單元 Operator Overloading II 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to.
Operations Management Unit 1: Using Operations to Compete 授課教師: 國立臺灣大學工商管理學系 黃崇興 教授 本課程指定教材為 Operations Management: Processes and Supply Chains, 10th ed.,
Operations Management Unit 12: Designing Effective Supply Chains 授課教師: 國立臺灣大學工商管理學系 余峻瑜 教授 本課程指定教材為 Operations Management: Processes and Supply Chains,
歐盟法與生命文化 ( 二 ) 第一單元 授課教師: Dr. Lukas Lien, University of Hamburg, Germany European Union as Paradigm of globalization-In mirror of German Thinking Tradition.
歐盟法與生命文化 (二) 第七單元 EU finance policies and crisis management Ideas for a new strategy of growth for Europe and Asia! 授課教師: Mr. Dieter Lutzenberger 1 【本著作除另有註明外,採取創用.
歐盟法與生命文化 ( 二 ) 第二單元 Legal and legislative crisis in EU and Asia : analysis and reform models? 授課教師: Dr. Claudius Petzold 德國檢察官 1 【本著作除另有註明外,採取創用 CC 「姓名標示-非.
後現代主義藝術 I : 對藝術機制的批判 ─ 觀念、地景與表演藝術 劉瑞琪 本著作除另有註明外,採取創用 CC 「姓名標示-非 商業性-相同方式分享」台灣 2.5 版授權釋出創用 CC 「姓名標示-非 商業性-相同方式分享」台灣 2.5 版.
歐盟法與生命文化 (二) 第九單元 Germany’s dual vocational training system: a model for other countries? 授課教師: Mr. Raoul Kubitschek Christian Mahnke Manager Science &
風格派: 抽象的知覺經驗與現代性 劉瑞琪 本著作除另有註明外,採取創用 CC 「姓名標示- 非商業性-相同方式分享」台灣 2.5 版授權釋出創用 CC 「姓名標示- 非商業性-相同方式分享」台灣 2.5 版.
實驗經濟學一:行為賽局論 Experimental Economics I: Behavioral Game Theory 補充材料:於現實驗證賽局理論:Swedish LUPI Lottery 賽局 Additional Material: “Testing Game Theory in.
Aristotle I Man as a Political Animal
本著作除另有註明外,採取創用CC「姓名標示-非商業性-相同方式分享」台灣2.5版授權釋出
實驗經濟學一:行為賽局論 Experimental Economics I: Behavioral Game Theory 第九講:學習理論:制約、計牌與EWA Lecture 9: Learning: Reinforcement, Fictitious Play, and EWA 授課教師:國立臺灣大學.
Introduction to Digital Speech Processing
Presentation transcript:

計算機程式 第七單元 Pointers and Strings 授課教師:廖婉君教授 【本著作除另有註明外,採取創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版授權釋出】創用 CC 「姓名標示 -非商業性-相同方式分享」台灣 3.0 版 本課程指定教材為 C++ How to Program, 7/e, Harvey M. Deitel and Paul J. Deitel, both from Deitel & Associates, Inc. © 2010 。 本 講義僅引用部分內容,請讀者自行準備。 1 本作品轉載自 Microsoft Office 2007 多媒體藝廊,依據 Microsoft 服務合約及著作權法 第 46 、 52 、 65 條合理使用。 Microsoft 服務合約

Pointer Variables int a=12; int *aptr; double *bptr, cptr; aptr = &a; int n=3, *nptr = &n; *aptr = *nptr + 5; a = n + 5; Q: &*aptr = *&aptr??? 2 Note: A pointer can only be assigned to 0, NULL, and an address. 12 aptr a

* and & Operators 3 OperatorsAssociativityType () []left to righthighest static_cast ( operand )left to rightunary (postfix) ! & *right to leftunary (prefix) * / %left to rightmultiplicative + -left to rightadditive >left to rightinsertion/extraction >=left to rightrelational == !=left to rightequality &&left to rightlogical AND ||left to rightlogical OR ?:right to leftconditional = += -= *= /= %=right to leftassignment,left to rightcomma

Call-by-Reference with Pointer Fig. 8.7 (p. 352) vs. Fig (p.226) 4

5 p.351

6 p.352

Using const with Pointer Non-constant pointer to non-constant data o int *aptr; Fig. 7.4, p. 329 Non-constant point to constant data o const int *aptr; Fig. 7.10, p. 336 Constant pointer to non-constant data o int * const aptr = &a; Fig. 7.11, p. 337 Constant pointer to constant data o const int * const aprt = &a; Fig. 7.12, p

Pointer vs. Array Constant pointer to non-constant data o e.g., int a[20], *aptr; aptr = a; aptr = &a[0]; Passing array into a function, o Fig (p. 360) vs. Fig (p. 301) o int * b vs. int b[] 8

Pointer vs. Array (cont.) Pointer arithmetic o int a[10], *aptr =a; aptr++; aptr += 3; Notation o Pointer/offset notation a[3] = *(a+3), *(aptr+3) &a[3] = a+3, aptr + 3 o Pointer/subscript notation a[3] = aptr[3] 9

10 p

Note: sizeof 11 p

Pointer vs. String char color[] = “blue”; char color[] = {‘b’, ‘l’, ‘u’, ‘e’, ‘\0’}; const char *colorptr=“blue”; char *c = &color[0]; cin >> color; cout<<color; cin>>setw(5)>>color; cin.getline(sentence, 80, ‘\n’); cin.get(); 12

Function Pointer A pointer to a function contains the function’s address in memory. Pointers to functions can be o Passed to functions o Returned from functions o Stored in arrays o Assigned to other function pointers o Used to call the underlying function 13

Function Pointer (cont.) 14 p

版權聲明 15 頁碼作品版權圖示來源 / 作者 1-15 本作品轉載自 Microsoft Office 2007 多媒體藝廊,依據 Microsoft 服務合約及著作權法第 46 、 52 、 65 條合理使用。 2 C++ How to Program, 7/e ,作者: Harvey M. Deitel and Paul J. Deitel , 出版社: Deitel & Associates ,出版日期: 2010 , P.348 。 依據著作權法第 46 、 52 、 65 條合理使用。 3 C++ How to Program, 7/e ,作者: Harvey M. Deitel and Paul J. Deitel , 出版社: Deitel & Associates ,出版日期: 2010 , P.350 。 依據著作權法第 46 、 52 、 65 條合理使用。 5-6, 10-11, 14 Open Clip Art Library ,作者: aritztg ,本作品轉載自: ,瀏覽日期: 2013/1/10 。 12 Open Clip Art Library ,作者: Chrisdesign ,本作品轉載自: , , , , 瀏覽日期: 2013/1/21 。