|
-
February 10th, 2009, 12:11 AM
#1
delegate type inside a method
Hi All,
I am new to c# programming so sorry for asking a trivial question. I have a small query. I have read that "delegate type and ordinary types cannot be defined inside a method". I want to know what is the reason behind this.can anybody explain this to me?
-
February 10th, 2009, 02:19 AM
#2
Re: delegate type inside a method
You can use anonymous delegates (C# 2.0) and lambda expressions (C# 3.0). For types you can use anonymous types (C# 3.0).
-
February 10th, 2009, 08:58 AM
#3
Re: delegate type inside a method
Reason? It was designed this way. Maybe because it helps keep the grammar and the compiler simplier. Maybe be because it helps to obey minimal feature set which can be common for most of languages and platforms, in other words it is a way how to obey the CLS/CTS standards.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|