I've been stuck on this problem for 3 hours now and if anyone could help or point me in the right direction I would greatly appreciate it.
PROGRAM: This program below is designed to read strings from a txt file, sort them alphabetically, skipping any blank lines, ignore duplicates, and ignore different cases.
ISSUE: I am supposed to not permanently convert the name case, instead compare lowercase (or uppercase) versions of the text for sorting purposes.
How can I compare lowercase or uppercase versions of the text without permanently converting the name case?
Btw: you don't need to convert all elements each time. Just the last one.
You don't need two nested loops. Plus you can do both within the loop after you extracted the name: sort and exclude with a single loop
I am supposed to not permanently convert the name case, instead compare lowercase (or uppercase) versions of the text for sorting purposes.
I'm a bit confused. You compare what with what?
Anyway, if you're not supposed to permanently convert them, then don't.
You only need them to be converted when you sort them, right?
If so, use std::sort() and feed it your custom comparison function/functor. http://cplusplus.com/reference/algorithm/sort/
Edit: I also advise that you use std::list<Student> or std::vector<Student> instead of a Student[] C array. That way, you no longer need to worry about the size.