Hi, I have searched the internet and cannot find anything on how to set a variable as a default parameter. Here is and example of the function:
The error is because I am trying to us a variable as the default parameter. Any help would be apreciated.
error:
using System;
int prePickedNum = 2;
void MyFunction(int num = prePickedNum)
{
num += 1;
}
MyFunction();
The error is because I am trying to us a variable as the default parameter. Any help would be apreciated.