Abraxas/ECS C++ Home  Table of Contents 

Module - 88.html

ABRAXAS SOFTWARE - CodeCheck ECS C++ Test-Suite ECS C++.

ECS C++-C Test Suite for Module - 88.cpp

/*

88. Use inline functions instead of macros.

*/
#define _SQRT(x) sqrt(x)



Function Name: SQRT()

inline double SQRT(int x) {
return ( sqrt(x) );
}



Function Name: main()

main() {
  
double hypo;
  hypo = _SQRT ( 2 );  // BAD 88, don't use macros
  
  hypo = SQRT ( 2 );    // GOOD 88, inline 
  
}

Abraxas/ECS C++ Home  Table of Contents

ABRAXAS SOFTWARE - CodeCheck ECS C++ Test-Suite ECS C++