lec0128-params - Todays announcements: Course policies:

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Todays announcements: Course policies: http://cs.illinois.edu/class/cs225 Email assistance (ews, svn): cs225help@cs.illinois.edu Sections meet in Siebel 0224, NOT Siebel ARR. MP2 available, due 2/8, 11:59p. EC due 2/1, 11:59p. Proficiency exam: 1/31, 7-10p, Siebel 2407 DYB 6-8p tonight, Siebel 1404. Stack vs. Heap memory: void fun() { string s = hello!; cout << s << endl; } int main() { fun(); return 0; } void fun() { string * s = new string; *s = hello?; cout << *s << endl; delete s; } int main() { fun(); return 0; } System allocates space for s and takes care of freeing it when s goes out of scope. Data can be accessed directly, rather than via a pointer. Allocated memory must be deleted programmatically. Data must be accessed by a pointer. Pointers and objects: face a, b; // init b a = b; a.setName(ann); b.getName(); face * c, * d; // init *d c = d; c->setName(carlos); (*d).getName(); class face { public: void setName(string n); string getName(); private: string name; BMP pic; boolean done; };...
View Full Document

Page1 / 12

lec0128-params - Todays announcements: Course policies:

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

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