View Single Post
Old Mar 19th, 2006, 12:35 PM   #9
codylee270
Unverified User
 
Join Date: Sep 2005
Posts: 209
Rep Power: 0 codylee270 is an unknown quantity at this point
i read somewhere that FIND() was best used with strings. I dunno if that's true or not, but since it's not working with my float vector, i just went ahead with my normal approach.

for(i=0; i<copy_nums.size(); ++i)
     {
              if(copy_nums[i] == min)
              {
                              offset_min = i+1;
              }
     }
     
     for(i=0; i<copy_nums.size(); ++i)
     {
              if(copy_nums[i] == max)
              {
                              offset_max = i + 1;
              }
     }
                              
     cout << "\n\nThe min value you entered is " << min << "." << endl;
     cout << min << " is #" << offset_min <<" in the list.\n" << endl;
     cout << "\nThe max value you entered is " << max << "." << endl;
     cout << max << " is #" << offset_max<<" in the list.\n" << endl;
}

Dawei, what exactly is CERR? I haven't seen that yet. Could you elaborate please?
thanks very much
codylee270 is offline   Reply With Quote