COM SCI 31 Lecture Notes - Lecture 8: Function Prototype, String Literal

30 views3 pages
25 Apr 2017
School

Document Summary

For (int k = 0; k!= t. size(); k++) (cid:272)out << (cid:862)the (cid:374)u(cid:373)(cid:271)e(cid:396) of es (cid:894)uppe(cid:396) a(cid:374)d lowe(cid:396) (cid:272)ase(cid:895) is (cid:863) << (cid:374)u(cid:373)(cid:271)e(cid:396)ofes << e(cid:374)dl; st(cid:396)i(cid:374)g s = (cid:862)hello(cid:863); char c = s[1]; // c is a char (initialized to lower case e) // s is a st(cid:396)i(cid:374)g; (cid:862)hello(cid:863) is a st(cid:396)i(cid:374)g lite(cid:396)al if (cid:894)t[k] == (cid:858)e(cid:859) || t[k] == (cid:858)e(cid:859)(cid:895) numberofes++; If(cid:894) t[k] a(cid:374) upper case e or a lower case e) If t is of type string, then t[] is of type char: t(cid:396)i(cid:374)g: (cid:862)(cid:863) (cid:859) (cid:858) (cid:859) (cid:858)\(cid:374)(cid:859) Cha(cid:396): (cid:858)(cid:859) (cid:858)(cid:271)(cid:859) (cid:858)w(cid:859) (cid:858) (cid:858) (cid:858)\(cid:859)(cid:859): si(cid:374)gle (cid:395)uote (cid:272)ha(cid:396)a(cid:272)te(cid:396); (cid:858)\(cid:859): (cid:271)a(cid:272)k slash (cid:272)ha(cid:396)a(cid:272)te(cid:396) cout << (cid:862) he said, \(cid:863)hello! (cid:863)\, then left. (cid:863); \: backslash (backward slash) (inside string literals & characters to escape the next character) (cid:272)ha(cid:396) (cid:272) = (cid:858)(cid:454)(cid:859); (cid:272)ha(cid:396) (cid:272) = (cid:862)(cid:454)(cid:863); For (int k = 0; k != phone. size(); k++) if (isdigit(phone[k])) numberofdigits++;

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