You are here

return

6 February, 2015 - 16:35

The return is allowed in good structured programming, but only at the end of a function. A function should not pre-maturely end by having the logic of the function have it terminate by jumping back to the function that called it.

Example 12.10: C++ source code

//****************************************************** // get data //****************************************************** 
void get_data(void)  {  // Input - Test Data - 5678.9, 5432.1  cout  << "nnEnter the length of the property in feet --->: ";  cin  >> property_length;  cout  << "nnEnter the width of the property in feet ---->: ";  cin  >> property_width;  return;  }