Important alert: (current site time 7/15/2013 4:52:49 PM EDT)
 

winzip icon

[ Lines Counter ]

Email
Submitted on: 9/5/2002 1:34:52 PM
By: Gonzales Cenelia  
Level: Intermediate
User Rating: By 7 Users
Compatibility: C, C++ (general), Microsoft Visual C++, Borland C++, UNIX C++
Views: 21823
author picture
(About the author)
 
     Have you ever wanted to count the lines of your code in C or C++ without the commentaries and blank lines,well with this program you can do it. Please feel free to vote or to live some comments,it will be very appreciated!
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 49 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

9/6/2002 11:54:46 AMCarl Nagy

This program is really useful. At work, we use a similar program to help us measure our productivity. However, the program we use counts the semicolons (;) in the file and uses that number as the number of statements. That seems like a more accurate method than just counting non-blank, non-comment lines because one statement could span multiple lines. Just something to think about.
(If this comment was disrespectful, please report it.)

 
9/10/2002 7:32:06 PMGonzales Cenelia

Thanks Carl Nagy for the suggestion,however when i had first wrote this program,the main purpose of it was to only count the number of lines in a program.But i found your suggestion very interesting,so i might eventualy try to write a program that will count the number of statements as well.
(If this comment was disrespectful, please report it.)

 
9/10/2002 7:35:04 PMGonzales Cenelia

If any one else would like to add some comments,please feel free to do so !
(If this comment was disrespectful, please report it.)

 
2/6/2004 6:54:35 AM

hii, great code!!
i had try to run it.. very usable..
congratulations!!
(If this comment was disrespectful, please report it.)

 
1/19/2005 10:20:23 PMGonzales Cenelia

hey,duyspvm,i dont know what is your real name. But i just dont understand why you would vote poor for the code.
unless you have some good explanation on why you did it. I think that you are exageratig a lot. Anyway,it looks to me that a lot of other people love the code,so i will just ignore that vote.
(If this comment was disrespectful, please report it.)

 
2/21/2005 8:01:03 AMdurgaPs

Hi Caneli

I have a suggestion to the code. It seems that the code does not count the following cases:

1. if the line is something like this:
printf ("Hellow World /*This is comment*/") -- This would give true to isblankline ();

2. What is the case when a line is like this:
int main () // Writing the main functiion
{}
the comment at the end of the code would make the iscommentary() to return true, which it should not, actually!

Best regards
//durgaps
durgaprasadsharma@gmail.com

(If this comment was disrespectful, please report it.)

 
2/21/2005 11:54:56 AMGonzales Cenelia

Alright,this is an old version of the code that i have done before,i have a brand new one and i will publish it on PSC probably this week.

Best Regards - Gonzales
(If this comment was disrespectful, please report it.)

 
8/18/2007 6:38:48 AMAmit

Very nice n useful program,
but there was no need to check whether the file exists or not using "windows.h"
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.