CMPSC 60 F08 lecture notes: Passing by constant reference, etc.

CMPSC 60 F08 lecture notes: Passing by constant reference, etc.

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: CMPSC 60 Week 3 . Tuesday Example: passing by constant reference class BankAccount; void welcome(const BankAccount& yourAccount); //Passes reference to yourAccount, but welcome(...) is not allowed to modify any data int main(...) { BankAccount account1(6543.21, 4.5), account2; welcome(account1); cout << Enter data for account 2:\n; //... } Misc. non-member funcitons it functions dened for use with a class, dened outside 1 ...
View Full Document

This note was uploaded on 12/10/2008 for the course CS 60 taught by Professor Holl during the Fall '97 term at UCSB.

Ask a homework question - tutors are online