In c++ how do I count the number of strings for the first line of a stream?
gampalu
0
Junior Poster in Training
Recommended Answers
Jump to PostWhen you read a string, increment a counter.
Jump to PostMaybe tinker with this:
http://www.daniweb.com/code/snippet444.html[edit]Or maybe this instead.
#include <stdio.h> int main(void) { static const char filename[] = "file.txt"; /* the name of a file to open */ FILE *file = fopen(filename, "r"); /* try to open the file */ if ( file != …
All 6 Replies
Dave Sinkula
2,398
long time no c
Team Colleague
gampalu
0
Junior Poster in Training
Dave Sinkula
2,398
long time no c
Team Colleague
gampalu
0
Junior Poster in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.