c++ skipping the if and for loops?

just looking at this code

int id, c, w, mis, s, numberL;
string answer, a, correct;
string info[numberL];

What – in your mind – does numberL contain? The number of lines in the file? (I am guessing here) The number of Lessons? Whatever it is supposed to be you need to set it. Look at the third line – you are telling the compiler to allocate that many lines – it doesnt know how many lines you mean. The loops get equally confused

This is not a language question it is a program design question – what does numberL mean?

Leave a Comment