Hi,
A few comments:
Are you allowed to use
std::string
? If so, then try to avoid writing C code in your C++.
Line 15 is bad practise - google to see why that is.
Also don't have global variables.
When you open files, check to see that it worked.
Always initialise your variables to something when you declare them - not doing this is one of the biggest traps.
Line 30: Usually there is an increment in the for loop statement, as in :
30 31 32 33 34
|
for(int i = 0; i < size; i++;)
{
dictionary >> words[i];
i++;
}
|
Line 49 : what are the values of those 2 variables - does this give a clue as to why that whole loop doesn't run?
Line 58 & 69: the usual idiom for a for loop is:
58 59 60
|
for (int frop=counter2; frop < counter; frop++) {
}
|
You can investigate using a debugger - hopefully your IDE has a built in one. You can step through code 1 line at a time & keep an eye on the values of variables. You can do break points & watch lists. Other wise there is poor man's debugging which uses
std::cout
to print out the values of variables everywhere.
hope this helps :+)
Edit:
We look forward to seeing your new code. Hopefully you can get really good marks if you implement the things that I mentioned.
Also, can you come with better variable names, meaningful names help self document the code & aid a great deal in understanding by various people - even yourself if you look at this code in a year's time.