Ok, here comes the "looking stuff up" part... Take a look at the stuff in your entries loop. Actually look them up in the C library documentation and study how they work... Does anything in that documentation suggest a way of ending the loop?
That's because of the for (int i ... With the declaration inside the braces is a C-99 enhancement and you are not using a C-99 capable compiler.
Yet another case for looking stuff up.
Seriously... Do you know the 4 rules of computer bliss?
1) Read the effing screen
2) Read the effing help file
3) Read the effing manual
4) Ok, now you can ask your question.
Seriously... This has been around for years and years... Ever heard RTFM... well, that's were it comes from.
anduril462 already answered my question in an exceptional manner, and I didn't ask for any further clarification. So for you to comment in a childish manner is unneeded and rather useless.