lec0216-linkedintro - Todays announcements: MP3 available,...

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

View Full Document Right Arrow Icon
Today’s announcements: MP3 available, EC due 2/18, due 2/25, 11:59p. Exam 1: 2/22, 7-9p, rooms TBA on Exams page of web site Jeopardy – round 2 today, Siebel 2405. Today: linked memory
Background image of page 1

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

View Full DocumentRight Arrow Icon
Class templates: Challenge1: write the function signature for the copy constructor (if we needed one) for this class. :: ( ) template <class T> T mypair<T>::getmax() { T retmax; retmax = (a>b? a : b); return retmax; } template <class T> mypair<T>::mypair(T first, T second) { a = first; b = second; } template <class T> class mypair { private: T a, b; public: mypair(T first, T second); T getmax(); }; Challenge2: How do you declare a dynamic array of mypair s of integers? Challenge3: How do you allocate memory if you want that array to have 8 elements?
Background image of page 2
struct listNode { LIT data; listNode * next; listNode(LIT newData):data(newData),next(NULL){} }; listNode nln; What is the result of this declaration? What declaration and initialization would result in this memory configuration?
Background image of page 3

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

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

Page1 / 10

lec0216-linkedintro - Todays announcements: MP3 available,...

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