hi, i am a beginner and trying to learn how dynamic arrays works, i have the function here but having troubles on implementing them on main, pls help me //............. int FindItemIndex(const vector Array, const String Goal) /*Returns the inxed of the first occurrence of Goal in Array, or -1 if Goal not in List. Post: The index of the first occurence of Goal in Array returned, or -1 returned if Goal not in Array*/ { for (int i = 0; i &Array,const String &ValToAdd) /*Incresase size of Array by 1 and ads ValToAdd to ARray as the last element Post: Array length increased by 1 and ValToAdd is last element of array*/ { Array.resize(Array.length()+1); Array[Array.length()-1]= ValToAdd; } //................... void RemoveFromArray(vector &Array, const String &ValToDelete) /*Deletes ValToDelete from ARray and decreases size of Array by 1 Pre: ARray is of size >= 1 Post: Array length has decreased by 1 and VAlToDelte is removed */ { int Index = FindItemIndex (Array, ValToDelete); or (;IndexArray.length()-1;Index++) Array[Index]= Array[Index+1]; Array.resize(Array.length()-1); } //.............. |