Vector Base Class

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2008
Posts: 16
Reputation: Squeeker is an unknown quantity at this point 
Solved Threads: 0
Squeeker Squeeker is offline Offline
Newbie Poster

Vector Base Class

 
0
  #1
Apr 25th, 2008
Hello all,

I have an assignment to create a base class for a vector. Now after reading through the instructions I am still unclear the instructions. I am NOT asking for you to do my homework! I just need some clarification. PLEASE DO NOT POST ANY CODE!

Here is a snippet of the assignment text:
Suppose that vectors were not defined in C++. Define a class called VectorDouble that is like a class for a vector with base type of double......Your class should have all of the following:
*Three constructors: a default constructor that creates a dynamic array for 50 elements........
*Member functions push_back, capacity...and size that behave the same as the member functions of the same names for vectors......
*Two member functions to give your class the same utility as the square brackets: value_at(i), which returns the value of the ith element in the dynamic array; and change_value_at(d,i) which changes the double value at the ith element of the dynamic array to d. Enforce suitable restrictions on the arguments to value_at(i) and change_value_at. (Your class will not work with the square bracket. It can be made to work with square bracket, but we have not covered the material which tells you how to do that.)
My question is does this mean I am not going to be using any vectors but rather dynamic arrays?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 16
Reputation: Squeeker is an unknown quantity at this point 
Solved Threads: 0
Squeeker Squeeker is offline Offline
Newbie Poster

Re: Vector Base Class

 
0
  #2
Apr 25th, 2008
Nevermind, I got it. Thanks.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC