so i have a list of reserved words i have to read in from an input file sort and then write to an output file. nothing except the title is being written. any help would be greatly appreciated. full driver programs to large but here's the part i'm struggling with. Thanks in advance. (input data below)
void sortEmRes(int a, string res[])
{
for (int i = 0; i < a - 1; i++)
{
for (int j = i + 1; j < a - 1; j++)
{
if(res[i] > res[j])
swapEm(res[j], res[j + 1]);
}
}
}
Not tested.
But that shouldn't be the reason that nothing but the title is written. You should post a minimal compilable example in order to reproduce the problem.
What you can do to determine the proble is add some debug couts.