Original Post
Hey everyone, in my program I have a function to find the index of the highest value in a vector. For some reason it's not letting me store anything that is inside of the vector into a temporary variable. ex: TempValue = Scores[0]; Its giving me an error saying: error C2440: cannot convert from std::vector<_TY> to 'double with [ _TY = double ]. Anyone know what might be causing this? My function code is below. Thanks int HighestElement(vector Scores[], int ElementCount) { double TempValue; int HighestValIndex; TempValue = Scores[0]; for(int x=1; x < ElementCount; x++) { if(Scores[x]>TempValue) { TempValue = Scores[x]; HighestValIndex = x; } } return HighestValIndex; }