SLOC Counter in C/C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vitcous
    New Member
    • Apr 2008
    • 1

    #1

    SLOC Counter in C/C++

    Hi all,
    have anyone known what the website that has (free or purchase both is OK) SLOC counter program (counting the source line of code) for a file in C/C++. I refer the program runs in DOS or Windows. I need the simple one and the result gives me a total number of SLOC for the C/C++ file or folder.
    Thank you.
    Vitcous
  • questionit
    Contributor
    • Feb 2007
    • 553

    #2
    Originally posted by vitcous
    Hi all,
    have anyone known what the website that has (free or purchase both is OK) SLOC counter program (counting the source line of code) for a file in C/C++. I refer the program runs in DOS or Windows. I need the simple one and the result gives me a total number of SLOC for the C/C++ file or folder.
    Thank you.
    Vitcous
    Hi

    Google 'SLOC' and you will find sample programs and algorithms for writing this program.

    I recommend you understand SLOC:
    Try this

    and then attempt to write a program to accomplish this task.

    Ofcourse there are many ways of doing it.

    What about writing a small program that will do the following:
    1- Open the file of your C program - the one that you have written (save it before running the program)
    2- Read and count number of lines in the file ( count by number of ';' or '\n' ) in this file
    3- Output the result.

    Regards
    Qi

    Comment

    Working...