Sample Program
On-Line Demonstrations of FlexeLint and PC-lint (aka FlexeLint for Windows)
Bug of the Month for Oct 2009
Bug of the Month Samples
A football analyst wanted to print out the names of football teams, blank-separated, four to a line. What could go wrong with such a simple program?
Modify this example, if desired, and then hit the Analyse Code button
#include
typedef const char *cString; cString teams[] = { "Giants", "Cowboys", "Eagles", "Redskins", "Lions", "Packers", "Bears", "Vikings", "Bills", "Dolphins", "Patriots", "Jets", /* ... */ }; #define Nlist (sizeof(teams) / sizeof(teams[0])) int main() { size_t i; for( i = 0; i < Nlist; i++ ) { printf( "%s ", teams[i] ); if( i % 4 == 4 ) printf( "\n" ); } printf( "\n" ); return 0; }
Run FlexeLint on Bug of the Month Samples
Home
|
Examples
|
Contact
|
Order
PC-lint and FlexeLint are trademarks of Gimpel Software
Copyright © 2009, Gimpel Software