Hi all.. i have a program to count LOC i.e. Line of code of a source file of any C++ program. The LOC shud not contain the comments count and also the blank lines. Now i m able to count to total lines of the program but the comments and the blank line count is proving very tough for me. coz // and /* both type of comments shud not be counted. if // comes after some valid C++ statement then it shud be counted as an LOC. for exa.
int a ; // variable declared.
This shud be counted as an LOC
int b=10 ; /* variable declared
with the value of 10 /*
this shud be counted as one LOC and one comment line.
also how to count the blank lines ??
so pls anyone who can solve this problem then pls help me with this program.