Hi
To all users
When the value of "string.Empty" parameter method I use, I encountered the following error:
Error 1 Default parameter value for 'Name' must be a compile-time constant.
public void SetName(string Name = string.Empty)
{
this.mName = Name;
}
thanks.
Saroj Kumar SahuPosted Jun 23, 2015, 1:35 AM
Pankaj Kumar ChoudharyPosted Jun 22, 2015, 8:31 PM
{
this.mName= string.Empty ?? Name;
}
behzad pakniyatPosted Jun 22, 2015, 4:18 PM
Dear user
I would not use the default value for the parameter.
Ramesh MaruthiPosted Jun 22, 2015, 12:20 PM