208 Day 04 String IO

208 Day 04 String IO - 4002-208 Intro. to Prog. [in C+] Day...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
4002-208 Intro. to Prog. [in C++] Day 04 Assignment Statement & Data Types
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objectives Non-numeric data types Input “statement” Input Buffer Formatting output 4002-208 Page 2
Background image of page 2
Boolean Data Type bool 1 byte that encodes true or false The value 0 represents false . All other values represent true . Examples bool hasFleas = true; bool endOfFile = 1; //set to true //better to use true or false Page 3 4002-208
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
char Data Type A char holds only one character Enclose character in single quotes Example: char gender = ‘f’; The escape character (‘\’) indicates the following character has special meaning ‘\n’ is the newline character ‘\t’ is the tab character Only one character in memory. 4002-208 Page 4
Background image of page 4
string Data Type A string holds a sequence of characters 1 byte per character In C++ string is a class. Examples string name = “”; string date = “09/08/08”; 4002-208 Page 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Non-numeric Literals String A sequence of characters enclosed in double quotes.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/31/2009 for the course NSSA 4002 208 taught by Professor Niemi during the Spring '09 term at RIT.

Page1 / 18

208 Day 04 String IO - 4002-208 Intro. to Prog. [in C+] Day...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online