We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

delegate

rnsr
rnsr asked
on
Medium Priority
336 Views
Last Modified: 2012-06-27
what does delegate( int y= function(2,3) ) mean?
Comment
Watch Question

Commented:
Are you sure it is written like that?
Maybe it is written like this: delegate() { int y = function(2,3); };

In this way, you create an anonymous method. by

            Action a = delegate()
            {
                 int y = function(2,3);
                 int j = function(4,5);
                 int z = y * j;
                 int k = y + j;
                 // The rest of the code here....
            };

            a.BeginInvoke(.....);

or
           a.Invoke();

Author

Commented:
you are right its like this
delegate() { int y = function(2,3); };

i wnat to know what is the role of delegate here.
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
And I can't tell what is the role of the code you wrote without seeing the rest of the code.
Someone/something must do something with this delegate (invoke it somewhere).

Author

Commented:
got my solution with this answer.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.