I am new to this board and new to programming as well.
The scenario is that
I am having to read lines of text (unknown lines) from external file and I need to sort them in alphabetical order ( lines consist of last name, first name, and jobtitle) and write to a different external file.
I am not allowed to use strings array but I am allowed to use
strcpy, strlen, strcomp etc..
I will read the first line as character array.
store character array to other variable array(?)
then I am lost. I think it's possible to use array of array?
Any help is greatly appreciated.
Post the code that you have so far.
int main ()
// Open the files
// Get data
char str ;
in.get (str, 80, '\n');
length = strlen (str);
for (int i=0; i<length; i++)
strcpy (line[i], str[i]);