1 / 18

Chapter 2

Chapter 2. Introduction to The C++ Language. Figure 2-1. Figure 2-2. Figure 2-3. Figure 2-4. Figure 2-5. Identifiers กฎสำหรับ Identifier ตัวอักษรแรกจะตัองเป็น A-Z หรือ a-z หรือ _ (underscore) Identifier จะประกอบด้วยตักอักษร ตัวเลข และ underscores

gladys
Download Presentation

Chapter 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2 Introduction to The C++ Language

  2. Figure 2-1

  3. Figure 2-2

  4. Figure 2-3

  5. Figure 2-4

  6. Figure 2-5

  7. Identifiers • กฎสำหรับ Identifier • ตัวอักษรแรกจะตัองเป็น A-Z หรือ a-z หรือ _ (underscore) • Identifier จะประกอบด้วยตักอักษร ตัวเลข และ underscores • Identifier จะต้องไม่ซ้ำกับคำสงวน

  8. Data Types • Set of Values • Set of Operations

  9. Figure 2-6

  10. Figure 2-7

  11. Figure 2-8

  12. Variables • Variable Declaration • TypeVariableName • เช่น intiVar ; • float fVar ; • char c ;

  13. Figure 2-9

  14. int count =0 ; // variable declaration and initialize int a, b=0; Variable Initialization

  15. Integer constants123, -10 Float constants0.0 , 1.5 Character constantsA character constant is enclosed in single quotes.‘a’ , ‘h’ , ‘c’ Constants

  16. Figure 2-10 String Constants

  17. Figure 2-11

  18. Figure 2-12 cin >> a Standard Output The standard output object in C++ is cout (console output). การส่งข้อมูลให้ cout จะใช้ insertion operator (<<)

More Related