How do I call a function without actually sending any values for its arguments?
For example I have the function

int Test ( int a, int b)
   {
      b= a * a ;
    }

then I call this function from some place in the program,

Test (??,??);

What do I have to do in order to call this function (trigger it) but not actually pass any values for a and b,,?

Thanks

In C++ functions can have parameters with default values

int Test ( int a = 1, int b = 2)
   {
      return a * b ;
    }

now when the program calls Test with no parameters, the compiler will force them to the values shown above.

int return_value = Test();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.