Sample Program
On-Line Demonstrations of FlexeLint and PC-lint (aka FlexeLint for Windows)
Bug of the Month for Jan 2007
Bug of the Month Samples
For New Year's Eve, James Bond orders his usual martini but has it analyzed first. One of the ingredients is suspiciously off. Which one?
Modify this example, if desired, and then hit the Analyse Code button
#include
class Drink { public: enum Ice { shaken, stirred } ice; float vermouth, gin, scotch; }; class Martini : public Drink { public: Martini() { vermouth = .10; gin = .90; } }; class BondMartini: public Martini { public: BondMartini() { ice = shaken; gin += vermouth / 2; vermouth /= 2; } }; int main() { BondMartini m; printf( "%d %g %g %g\n", m.ice, m.gin, m.vermouth, m.scotch ); 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