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. Regarding Functions

Regarding Functions

Scheduled Pinned Locked Moved C#
csharp
5 Posts 4 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.
  • V Offline
    V Offline
    vijaylumar
    wrote on last edited by
    #1

    hi in C language we use ellipses for unlimited arguments is it possible in C#

    S D 2 Replies Last reply
    0
    • V vijaylumar

      hi in C language we use ellipses for unlimited arguments is it possible in C#

      S Offline
      S Offline
      Shorgov
      wrote on last edited by
      #2

      Yap, you can do it this way

      public static void SuperCoolMethod(params int[] list)
      {
      // code here
      }

      ...

      SuperCoolMethod(1,2,3,4,5);

      1 Reply Last reply
      0
      • V vijaylumar

        hi in C language we use ellipses for unlimited arguments is it possible in C#

        D Offline
        D Offline
        dan sh
        wrote on last edited by
        #3

        AFAIK no. You can use a List instead.

        It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

        L 1 Reply Last reply
        0
        • D dan sh

          AFAIK no. You can use a List instead.

          It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          have a look at the params keyword. :)

          Luc Pattyn


          I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


          D 1 Reply Last reply
          0
          • L Luc Pattyn

            have a look at the params keyword. :)

            Luc Pattyn


            I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            :doh:

            It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

            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