CS 161 Lecture Notes - Lecture 5: Relational Operator, Delimiter, Memory Address

39 views3 pages

Document Summary

Variable data storage location with a name, referred to as a box. Primitive types different sizes of things to store, set sizes, pre-defined: floats, doubles, chars. Conditional checks if a statement is true or false and how to act. C style strings can also be used in c++ but not in this course: come from Allows us to take predefined data types: allows us to take in more than numbers or single entities. Used to make sure programs don"t crash when the user enters wrong data. Hello world : stored in box fashion, each character is its own box and can be evaluated. Use getline: there are two getline functions. getline -> takes the istream, takes the string variable, extracts until delimiter or \n (newline: use this one!! getline -> c-string: used in c programs. String my_str = ; cout << give me a string: ; getline(cin, my_str): strings are dynamic not a set size.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents