File Exchange

image thumbnail

SLOC counter

version 1.1 (2.13 KB) by

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

1 Download

Updated

No License

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')

Comments and Ratings (0)

Updates

1.1

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

MATLAB Release
MATLAB 7.2 (R2006a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video