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:
using System;
int prePickedNum = 2;
void MyFunction(int num = prePickedNum)
{
num += 1;
}
MyFunction();
The error is because I am trying to us a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.