《C++程序设计》(英文版) Chapter 3 Topics

Programming in C++ Numeric Types, Expressions, and Output Dale/weems/Headington
1 Numeric Types, Expressions, and Output

Programming in c++ Chapter 3 Topics 8 Constants of Type int and float Evaluating Arithmetic Expressions e Declaration for Numeric Types 8 Implicit Type Coercion and Explicit Type Conversion Calling a Value-Returning Function s Using Function Arguments s Using C++ Library Functions in Expressions Calling a Void Function % C++ Manipulators to Format Output s String Operations length, size, find, substr
2 Chapter 3 Topics v Constants of Type int and float v Evaluating Arithmetic Expressions v Declaration for Numeric Types v Implicit Type Coercion and Explicit Type Conversion v Calling a Value-Returning Function v Using Function Arguments v Using C++ Library Functions in Expressions v Calling a Void Function v C++ Manipulators to Format Output v String Operations length, size, find, substr

Programming in c++ C++ Data Types sImple structured integral enum floating array struct union class har short int long bool float double long double address pointer reference
3 C++ Data Types structured array struct union class address pointer reference simple integral enum char short int long bool floating float double long double

Programming in c++ C++ Simple Data Types simple types integral floating char short int long bool enum float double long double unsigned
4 C++ Simple Data Types simple types integral floating char short int long bool enum float double long double unsigned

Programming in c++ Standard Data Types in C++ sIntegral Types represent whole numbers and their negatives declared as int, short, or long & Floating Types represent real numbers with a decimal point declared as float, or double &Character Type represents single characters declared as char
5 Standard Data Types in C++ vIntegral Types • represent whole numbers and their negatives • declared as int, short, or long vFloating Types • represent real numbers with a decimal point • declared as float, or double vCharacter Type • represents single characters • declared as char

Programming in c++ Samples of C++ Data Values int sample values 4578 4578 0 float sample values 95274 95 265 9521E-3 95E-1 95213E2 char sample values B d′
6 Samples of C++ Data Values int sample values 4578 -4578 0 float sample values 95.274 95. .265 9521E-3 -95E-1 95.213E2 char sample values ‘B’ ‘d’ ‘4’ ‘?’ ‘*’

Programming in c++ Integral Types >The data types char, short, int, and long are intended to represent different sizes of integers > The sizes are machine dependent >For one particular machine, we might picture the sizes this way char memory cell short memory cel int memory cell long memory cell 7
7 Integral Types ØThe data types char, short, int, and long are intended to represent different sizes of integers. ØThe sizes are machine dependent. ØFor one particular machine, we might picture the sizes this way. char memory cell short memory cell int memory cell long memory cell

Programming in c++ Integral Types( Cont) >We can also explicitly add the reserved word unsigned to the data type name unsigned int )The unsigned integer value is assumed to be only positive or zero
8 Integral Types(Cont.) ØWe can also explicitly add the reserved word unsigned to the data type name: unsigned int ØThe unsigned integer value is assumed to be only positive or zero

Programming in c++ Scientific Notation 2.7E4 means 2.7x 104= 2.7000 27000.0 2.7E.4 means 27x 10-4= 00027 0.00027
9 Scientific Notation 2.7E4 means 2.7 x 10 4 = 2.7000 = 27000.0 2.7E-4 means 2.7 x 10 - 4 = 0002.7 = 0.00027

Programming in c++ More About Floating Point Values s floating point numbers have an integer part and a fractional part, with a decimal point in between Either the integer part or the fractional part, but not both, may be missing 今 EXAMPLES 18.4 500. 8 127.358 o alternatively, floating point values can have an exponent, as in scientific notation--the number preceding the letter E doesn't need to include a decimal point EXAMPLES 1.84E1 5E2 8E-1 -.127358E3 10
10 More About Floating Point Values v floating point numbers have an integer part and a fractional part, with a decimal point in between. Either the integer part or the fractional part, but not both, may be missing v EXAMPLES 18.4 500. .8 -127.358 v alternatively, floating point values can have an exponent, as in scientific notation--the number preceding the letter E doesn’t need to include a decimal point EXAMPLES 1.84E1 5E2 8E-1 -.127358E3
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《C++程序设计》(英文版) Chapter 2 Topics.ppt
- 《C++程序设计》(英文版) Chapter 1 Topics.ppt
- 《网络互连技术教程》第9章 广播.ppt
- 《网络互连技术教程》第8章 用户数据报协议—UDP.ppt
- 《网络互连技术教程》第7章 CMP和网络状态.ppt
- 《网络互连技术教程》第6章 地址解析.ppt
- 《网络互连技术教程》第5章 子网与超网.ppt
- 《网络互连技术教程》第4章 网络互连协议——IP.ppt
- 《网络互连技术教程》第3章 网络接入技术.ppt
- 《网络互连技术教程》第2章 网络互连体系.ppt
- 《网络互连技术教程》第1章 网络的历史与发展.ppt
- 《网络互连技术教程》第12章 应用服务.ppt
- 《网络互连技术教程》第11章 域名服务系统—DNS.ppt
- 《网络互连技术教程》第10章 传输控制协议—7CP.ppt
- 高职高专课程:《数据库应用技术(SQL SERVER2000)》电子教案(PPT教学课件)第9章 存储过程与触发器.ppt
- 高职高专课程:《数据库应用技术(SQL SERVER2000)》电子教案(PPT教学课件)第8章 视图及其应用.ppt
- 高职高专课程:《数据库应用技术(SQL SERVER2000)》电子教案(PPT教学课件)第7章 索引及其应用.ppt
- 高职高专课程:《数据库应用技术(SQL SERVER2000)》电子教案(PPT教学课件)第6章 SQL Server 2000 数据完整性.ppt
- 高职高专课程:《数据库应用技术(SQL SERVER2000)》电子教案(PPT教学课件)第5章 数据的基本操作.ppt
- 高职高专课程:《数据库应用技术(SQL SERVER2000)》电子教案(PPT教学课件)第4章 数据库中表的基本操作.ppt
- 《C++程序设计》(英文版) Chapter 4 Topics.ppt
- 《C++程序设计》(英文版) Chapter 5 Topics.ppt
- 《C++程序设计》(英文版) Chapter 6 Topics.ppt
- 《C++程序设计》(英文版) Chapter 7 Topics.ppt
- 《C++程序设计》(英文版) Chapter 8 Topics.ppt
- 《C++程序设计》(英文版) Chapter 9 Topics.ppt
- 《C++程序设计》(英文版) Chapter 10 Topics.ppt
- 《C++程序设计》(英文版) Chapter 11 Topics.ppt
- 《C++程序设计》(英文版) Chapter 12 Topic.ppt
- 《C++程序设计》(英文版) Chapter 13 Topics.ppt
- 《C++程序设计》(英文版) Chapter 14 Topics.ppt
- 《C++程序设计》(英文版) Chapter 15 Topics.ppt
- 《Java编程技术基础》第一章 面向对象原理与实现.ppt
- 《Java编程技术基础》第二章 Java的实现基础.ppt
- 《Java编程技术基础》第二章习题.doc
- 《Java编程技术基础》第三章 类与对象(一).ppt
- 《Java编程技术基础》第三章习题.doc
- 《Java编程技术基础》第四章 类与对象(二).ppt
- 《Java编程技术基础》第四章习题.doc
- 《Java编程技术基础》第五章 异常与垃圾收集.ppt