I'm doing the same thing now, but with an char array instead. This code gives me a syntax error, so do you know if there's a easy way to solve this or is there much that needs to be fixed?
What's up with line 83 and 84? You can never return multiple variables from a function (unless you create an object or array to hold the values in question).
Secondly there is an STL sort algo in the <algorithm> header; you'd have an easier time just using that rather than your bubble sort. You pass it pointers to the start and one after the end, I believe.
Third, why not just create an array of strings rather than an array of dynamically allocated char[]? Or even better use vector. MD arrays don't pass around too well.
Now then which line is your issue on? All your subscripts look fine.
The problem is that you did not specify a return type for sortera().
In C++ you can not normally declare a function without a return type.[1]
This is what you did: sortera(); // sortera() is a function that takes no arguments and which might return any or no type.
This is what should be done: int sortera(); // sortera() is a function that takes no arguments and returns an int.
or you could say void sortera(); // sortera() is a function that takes no arguments and returns nothing.
The reason why? C++ is a strongly typed language, which works very hard to make sure you do not make undefined type conversions. Your original function would break this system. For instance, you could create a pointer that points to some unknown location in memory (a Bad Thing). This is why the compiler returns an error.
In this particular case, I would guess that the compiler saw that your function lacked a return type, put the type void (nothing returned) and then got very surprised when you did actually return an int (and a char** in this case :)
[1] A class destructor or constructor is always declared with no return type, not even void. This is not relevant in this case, however.