Review of Function Types and Parameters

If a function does not return any values, you declare its type as void:
  void printResults( . . . );
If a function doesn't take any parameters as input, you declare its parameter list as void:
  void ringBell(void);
If a function returns a single value, you declare its type to be the same as the type you are returning:
  int getValueFromUser(. . .);
  char getLetterGrade(. . .);
  float calculateGPA( . . .);
If a function returns more than one value, you declare its type as void, and declare its output parameters as reference parameters of the same types you want to return:
void getSides(int &length, int &width);

void getScores(float &exam1, 
               float &exam2,
               float &exam3, 
               float &exam4);
Next page

Back to Lesson 6 Index
Back to Outline