By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,797 Members | 1,848 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,797 IT Pros & Developers. It's quick & easy.

How to Get d Line count of a text file Borland C++

P: 1
Please help me out
Is there any function in Borland C++ Builder which will return the total no of line of a text file
Nov 8 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
I don't it although I do not know Borland so do not know it they ship and non standard libraries that do this.

Using the standard library you would use the functions

fopen
fgets
fclose

To do this, since fgets reads a line from the file all you have to do is open the file and count how many times you can call fgets before you get to the end of file.
Nov 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.