cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
I want to show how many lines in afile
I want to show how many lines in afile
Apr 27, 2011 at 5:13pm UTC
nrshoukhin
(7)
suppose a file has two lines there are
i am shoukhin
i live in Bangladesh
and my program shows 2.
please give a solution
Apr 27, 2011 at 5:20pm UTC
anonymous23323124
(1383)
Well you could just open the file and read it line by line with getline, incrementing some line count each time. However, this is fairly inefficient and it is apparently quicker to read the whole file in one go and parse it in memory.
Topic archived. No new replies allowed.