| | |
Vector Base Class
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 16
Reputation:
Solved Threads: 0
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: My question is does this mean I am not going to be using any vectors but rather dynamic arrays?
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.)
![]() |
Similar Threads
- base class undefined (C++)
- help:stl vector of user defined objects (C)
- Another C++ N00B Begging For Help (C++)
- C++ derived class virtual functions (C++)
- Header organization (base and derived classes) (C++)
- 6 Line class -> Me pounding head into wall (C)
- java uses or overrides a deprecated API?? (Java)
Other Threads in the C++ Forum
- Previous Thread: char error
- Next Thread: c++ username code
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library lines linker list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets





