Sample Program
On-Line Demonstrations of FlexeLint and PC-lint (aka FlexeLint for Windows)
Bug of the Month for Jun 2008
Bug of the Month Samples
There were a lot of red faces at the university when an honorary degree was awarded to a Mr. Bin Laden. What went wrong?
Modify this example, if desired, and then hit the Analyse Code button
#include
#define DOCTORATE 1 #define CHOICE 2 const char *a[2][3] = { {"Hitler", "Stalin", "Bin Laden"}, {"Clinton", "Bush", "Powell" } }; int main() { const char **array; #if D0CT0RATE array = a[1]; #else array = a[0]; #endif printf( "An honorary doctorate award " " is issued to %s\n", array[CHOICE] ); }
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