Optional parameter declaration in C3 3.5
-
Is there any way to do optional variable declaration in c# 3.5. I have two alternatives. (a) Function Overloading (b) declaring the function arguments in Params Object[] variable Can i do it exactly the way we can do in vb.net ?
C# 4.0 introduces optional parameters, you can't do it in 3.5.
abcurl wrote:
Can i do it exactly the way we can do in vb.net ?
Why would you ever compare anything to VB? X| ;P
I know the language. I've read a book. - _Madmatt
-
C# 4.0 introduces optional parameters, you can't do it in 3.5.
abcurl wrote:
Can i do it exactly the way we can do in vb.net ?
Why would you ever compare anything to VB? X| ;P
I know the language. I've read a book. - _Madmatt
Mark Nischalke wrote:
Why would you ever compare anything to VB?
OK, well you can do optional parameters in C++. Would that have been a better comparison? ;P
Kevin
-
Mark Nischalke wrote:
Why would you ever compare anything to VB?
OK, well you can do optional parameters in C++. Would that have been a better comparison? ;P
Kevin
Yes, VB and C++ are much closer. :laugh:
I know the language. I've read a book. - _Madmatt
-
C# 4.0 introduces optional parameters, you can't do it in 3.5.
abcurl wrote:
Can i do it exactly the way we can do in vb.net ?
Why would you ever compare anything to VB? X| ;P
I know the language. I've read a book. - _Madmatt
Here is how to do it in 4.0: Named and Optional Arguments[^] Told you: shameless :-)
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
-
Mark Nischalke wrote:
Why would you ever compare anything to VB?
OK, well you can do optional parameters in C++. Would that have been a better comparison? ;P
Kevin
VB can compared to many things, normally prefixed with "A big steaming pile of....." :-)
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
-
C# 4.0 introduces optional parameters, you can't do it in 3.5.
abcurl wrote:
Can i do it exactly the way we can do in vb.net ?
Why would you ever compare anything to VB? X| ;P
I know the language. I've read a book. - _Madmatt
-
Mark Nischalke wrote:
C# 4.0 introduces optional parameters, you can't do it in 3.5.
Back to the future......
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest.
Honestly. It's the honest ones you want to watch out for...I'm polishing up the Delorean now ;P
I know the language. I've read a book. - _Madmatt
-
I'm polishing up the Delorean now ;P
I know the language. I've read a book. - _Madmatt
I never understood why it gathers that much dust while going back in time; most objects do when aging. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.