CSC 210 Notes

Posted in csc210 by bnmng on 2011 01/26

Lab next Wednesday. Test on Feb 7.
Homework assignment handed out.
Program assignment handed out

Today: Program 1, Chapter 3 Bag Class, sequence.

Advantage of friend function over member function: (look this up).

Changing ascii numbers to integers: bit mask or subtract ascii code for zero.
bit mask is faster.

The bag class:
A container of integers in no particular order. Integers can be doubled.

Sequence Class (a more practical example than the bag class)
Adding an additional private member (page 129), added the current index for accessing items
start, current, advance.
Loop on page 126.

For the sequence class, we need to insert and attach. Insert first, then attach.
Program 1: Don’t need to build a whole sequence class, just the functions given.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: