Package Index  Table of Contents

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

/*
81.   Declare for-loop iteration variables inside of for statements.
*/
// a loop iterator variable must be local to for-loop
int



Function Name: main()

main() {
 int i;
 
  for ( i=0; i<1; i++ ) {   // BAD 81
  
  }
  
  for ( int i=0; i<10; i++ ) {  // GOOD 81
  
  }
  
}

Package Index  Table of Contents

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