Be the first to rate this file! 7 Downloads (last 30 days) File Size: 2.13 KB File ID: #22993

SLOC counter

by

 

16 Feb 2009 (Updated )

This script reads a C-File and counts the source lines of code.

| Watch this File

File Information
Description

This script reads a C-File and counts the source lines of code (SLOC).

Following kinds of lines are not counted as source lines of code:
1) //comment
2) /*
...comment
/*
3) empty lines

to run the file:
[code_lines_nb, comment_lines_nb, empty_lines_nb] = get_sloc_cfile = get_sloc_cfile('test.c')

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
18 Feb 2009

- output also the number of comment lines and number of empty lines.

Contact us