Package Index  Table of Contents

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

// 118.  Use C++ casting operators instead of C-style casts.
int i = 1;
float j = 1.0;
// BAD 118, explicit old-style cast
i = (int) j;
// good 118
i = static_cast (j);

Package Index  Table of Contents

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