If you are not allowed to use vector then you will have to read the entire file, counting the line numbers as the loop progresses. There is no other way to do it.
Why do you need the line count? Maybe there are alternative ways to achieve what you want to do.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,949 posts
since Aug 2005