Create a function with no parameters - C++ Function

C++ examples for Function:Function Creation

Description

Create a function with no parameters

Demo Code

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

string Username()/*from  www  . j  av a2s.c  om*/
{
    return "test";
}

int main()
{
  cout << Username() << endl;
  return 0;
}

Result


Related Tutorials