array subscript

Hello, I need to get an array's subscript depending on its value since I'm sorting it through a link list in logical form. Logical Form is what my professors calls alphabetical order.

Now what I want is this.


string name[5] = {"Diana", "Fred", "Mary", "Tif", "Abel"};
int arraySub;

if(name[0]<name[1]) //which is obviously true
arraySub=(the subscript of the larger one)


Hope you can help me! Thanks
Last edited on
In the given case, can you not just assign 1 to arraySub? Perhaps a more detailed example of where you are having the problem might be useful.
Thanks, I got it, I got a brain fart I simply used a for loop. Thanks. But now that we are here already, do you happen to know if I have a string array and suddenly I want to empty a space how should I do it and also, how can I test for an array to see if it is empty?
Topic archived. No new replies allowed.