[Dev-C++] Newbie class/vector/implementation problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Dane E. <DE...@pa...> - 2004-05-27 20:34:13
|
Hi, =20 First, thank you in advance for any help you can offer. =20 Im working on a very limited and elementary program and I need help setting it up correctly. I have made a basic Employee class. I want to make a vector of Employee objects. I need=20 to be able to add, delete, and update Employee data, which is why I think I need a vector of them. =20 To begin with, I think that I would include the <vector> in my Employee implementation file. Then declare an Employee vector. When the user wanted to delete one, I would pass an indexed Employee vector as a parameter into a deleteEmployee() function. Would the function headerline look like this? =20 void deleteEmployee(Employee Emp ()) // Employee is the class, and Emp is the name of the vector. =20 Once I have successfully passed the Employee vector (i) into the function I think I would use a vector class function like:=20 vectorList.erase( i ); =20 to delete the employee record. How does this look to you? Dane =20 =20 |