Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Function Overloading

int plusFuncInt(int x, int y) {
  return x + y;
}

double plusFuncDouble(double x, double y) {
  return x + y;
}

int main() {
  int myNum1 = plusFuncInt(8, 5);
  double myNum2 = plusFuncDouble(4.3, 6.26);
  cout << "Int: " << myNum1 << "
";
  cout << "Double: " << myNum2;
  return 0;
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #Function #Overloading
ADD COMMENT
Topic
Name
1+1 =