Create a function with multiple parameters. - C++ Function

C++ examples for Function:Function Creation

Description

Create a function with multiple parameters.

Demo Code

#include <iostream>
#include <string>
using namespace std;

string appendName(string first, string last)
{
  return first + " " + last;
}

int main()/*from  w  ww. j a  v  a  2  s .c om*/
{
  cout << appendName("Richard", "Nixon") << endl;
  return 0;
}

Result


Related Tutorials