I have a working c file which count lines from a text file.
Is there a function that filters out lines with comments(lines started with //)?

So when I load in a text file with a c code, it only has to count the lines without comment.

Recommended Answers

I would investigate the functionality bundled up in the string library...especially functions like strstr().

Jump to Post

All 2 Replies

I would investigate the functionality bundled up in the string library...especially functions like strstr().

I have a working c file which count lines from a text file.
Is there a function that filters out lines with comments(lines started with //)?

So when I load in a text file with a c code, it only has to count the lines without comment.

No. That's the beauty of C -- you get to write all the filter functions yourself so they do exactly what you want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.