Package Index  Table of Contents

CodeCheck ECS C/C++ to Test Suite - 80.cpp

/*
80.   Declare global functions, variables, or constants as static members of a class.
*/
// bad, should be static in class
int PI = 3.14159;
int glofoo(void);
class foo {
  
  // good
  static int global;
  
  static int glofoo( void );
  
};

Package Index  Table of Contents

CodeCheck Copyright (c) 1988-2005 by Abraxas Software Inc. (R). All rights reserved.