lec0131-ctors - Todays announcements: Course policies:

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

View Full Document Right Arrow Icon
Today’s announcements: Course policies: http://cs.illinois.edu/class/cs225 Email assistance (ews, svn): [email protected] 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Parameter passing summary: struct stu { string n; BMP mug; bool pt; // print flag }; bool ps1(stu s){ if (!s.pt) cout << s.n; return true; } stu a; … // init a a.pt = ps1(a); cout << a.pt; Example of use Function defn void ps3(stu & s){ if (!s.pt) cout << s.n; s.pt = true; } stu c; … // init c ps3(c); cout << c.pt; void ps2(stu * s){ if (!s->pt) cout << s->n; s->pt = true; } stu * b; … // init *b ps2(b); cout << b->pt;
Background image of page 2
Return values: struct student { string name; BMP mug; bool printed; // print flag }; bool print_student1(student s){ if (!s.printed) cout << s.name << endl; return true; } int main() { student a; bool b = print_student1(a); } Stack What happens when we run code like this: ?
Background image of page 3

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

View Full DocumentRight Arrow Icon
Returns: student c; student * d;
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/26/2012 for the course CS CS 225 taught by Professor Heeren during the Spring '09 term at University of Illinois, Urbana Champaign.

Page1 / 8

lec0131-ctors - Todays announcements: Course policies:

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

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