COP-3014 Lecture Notes - Lecture 2: Null Pointer, C Data Types, English Alphabet

62 views4 pages
18 Mar 2016
School
Course
Professor

Document Summary

Input string cannot be any larger than 19 because of the need for the terminaion character (\0) #include s2. #include using namespace std; int main(void) string s1, s2, s3, s4; s1 = david ; s2 = alan ; s3 = gaitros ; s4 = s1 + s2 + s3; cout << s4 << endl; return 0; In order to iniialize: string s1( david ), string s1 = david , s1 = david ; February 15, 2016 pointers and dynamic memory allocaion. Int *yptr; yptr = &y; cout << *yptr << endl: * indicates that it will be followed by a pointer name (null pointer, &y returns the locaion of y iii. In the above funcion, y and *yptr refers to the same 5; when one changes, the other one also changes: example:

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