Home > Net >  C # function is not allowed to have a default parameters?
C # function is not allowed to have a default parameters?

Time:09-16

Public void WriteLog (string strErrMsg, string strFuncName, int iFileType=1)

Function is that the prompt "specifier is not allowed to have default parameters" error, how can I solve

CodePudding user response:

Vs2010 to support this, at least,

CodePudding user response:

Didn't encounter this problem,
Are you vs version is too low in c # features high version

CodePudding user response:

refer to the second floor hez2010 response:
didn't encounter this problem,
Are you vs version is too low in high version c # features

It should be my is vs2005

CodePudding user response:

Didn't find the shrimps question
 public void WriteLog (string strErrMsg, string strFuncName, int iFileType=1) {} 

CodePudding user response:

Luo 1 in high version

CodePudding user response:

reference jasonclf reply: 3/f
Quote: refer to the second floor hez2010 response:

Didn't encounter this problem,
Are you vs version is too low in high version c # features

That should be my is vs2005

Directly in 2019

CodePudding user response:

1 you vs version whether high version
The framework is 4.0 or 4.0 above

CodePudding user response:

It is as if the.net features, is not a feature of c #, c # does not allow this to create function, but the high version of the. NET you wrote, will give you create a variable, the default vs2013 so I write error,,,
  •  Tags:  
  • C #
  • Related