C++ Functions

Item Syntax Notes
Function Header RtnType FunctionName (paramlist) {statements}
  • The RtnType can be void
  • The paramlist is optional
  • No semicolon on the end
  • Returning Values RETURN expression;  
    Function Prototype RtnType FunctionName (paramlist);
  • Necessary when a function is used before it's defined. All datatypes must match the function header
  • Same as a function header, PLUS a semi-colon
  • Parameter names are optional, and can be different than in the function header.