Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. method declaration

method declaration

Scheduled Pinned Locked Moved C#
questionhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HUMPPAAA
    wrote on last edited by
    #1

    Hello, my question today is, how do I declare a method which accepts the reference pointer on an other method as argument. here is some pseudo code to demonstrate what I mean. void humppa() {...} void IwantHumppa(????????){...} void Main() { IwantHumppa(humppa); } The "??????????" is the part I don't know and where hopefully you guys can help me! Thx! ~HUMPPAAA!

    E P 2 Replies Last reply
    0
    • H HUMPPAAA

      Hello, my question today is, how do I declare a method which accepts the reference pointer on an other method as argument. here is some pseudo code to demonstrate what I mean. void humppa() {...} void IwantHumppa(????????){...} void Main() { IwantHumppa(humppa); } The "??????????" is the part I don't know and where hopefully you guys can help me! Thx! ~HUMPPAAA!

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #2

      delegate void SampleDelegate(int arg1, int arg2, string abc); private void SomeOtherMethod(int arg1, int arg2, string abc){} private void SomeMethod(SampleDelegate sd){ sd(1,2,"test"); } Then in some method SampleDelegate sd = new SampleDelegate(SomeOtherMethod); SomeMethod(sd);


      File Not Found

      1 Reply Last reply
      0
      • H HUMPPAAA

        Hello, my question today is, how do I declare a method which accepts the reference pointer on an other method as argument. here is some pseudo code to demonstrate what I mean. void humppa() {...} void IwantHumppa(????????){...} void Main() { IwantHumppa(humppa); } The "??????????" is the part I don't know and where hopefully you guys can help me! Thx! ~HUMPPAAA!

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        You want a delegate.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups