Create a function which doesn't return anything. - C++ Function

C++ examples for Function:Function Creation

Description

Create a function which doesn't return anything.

Demo Code

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

void setName(string newname)
{
  cout << "New user is " << newname << endl;
}

int main()/*from   w ww  .j av  a2s  . co  m*/
{
  setName("a");
  return 0;
}

Result


Related Tutorials