Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 707517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:17:11+00:00 2026-05-14T04:17:11+00:00

The delegates in C# offer similar functionality as function pointers in C. I heard

  • 0

The delegates in C# offer similar functionality as function pointers in C. I heard someone saying “C# delegates are actually better than function pointers in C”. How come? Please explain with an example.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:17:12+00:00Added an answer on May 14, 2026 at 4:17 am

    “Better” is subjective — but the main differences are:

    • Type safety. A delegate is not only guaranteed to refer to a valid method, it is guaranteed to refer to a method with the correct signature.
    • It’s a bound method pointer — that is, the delegate can point to a specific object on which to call the delegate. Thus, an Action<string> delegate could refer to alice.GetName or bob.GetName rather than just Person.GetName. This might be similar to C++ “pointer to member” — I’m not sure.

    In addition, the C# language supports closures through delegates to anonymous methods and lambda expressions — i.e. capturing local variables of the declaring procedure, which delegate can reference when it later gets executed. This isn’t strictly speaking a feature of delegates — it’s enabled by the C# compiler doing some magic on anonymous methods and lambda expressions — but it’s still worth mentioning because it enables a lot of the functional idioms in C#.

    EDIT: As CWF notes in comments, another possible advantage of C# delegates is that the delegate type declarations are easier for many people to read. This may be a matter of familiarity and experience, of course.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There have been proposals for C++ delegates which have lower overhead than boost::function :
I understand that Delegates offer high performance reflection maybe just 15% slower than regular
I know that Asycronous Delegates are used for implementing Call back functionality in .NET.
I am looking to try and understand delegates better. I've looked over the examples
I want to offer the user with the possibility of taking more than one
im trying to learn delegates and events in c#, i understand that an event
I'm rusty with delegates and closures in JavaScript, and think I came across a
C# has anonymous delegates. So I can write: public vois foo(string d, Action t){
Both are delegates and have the same signature, but I can not use Action
While inspecting delegates in C# and .NET in general, I noticed some interesting facts:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.