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 / C++ / MFC
  4. Functional Parameters

Functional Parameters

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 2 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.
  • P Offline
    P Offline
    Paul Belikian
    wrote on last edited by
    #1

    I've seen functions defined as:

    int SetIniString(int nConfigSet, char \*Section, char \*Key, const char \*format, ... );
    

    Could someone explain what the '...' in the parameter list means and does?

    L 2 Replies Last reply
    0
    • P Paul Belikian

      I've seen functions defined as:

      int SetIniString(int nConfigSet, char \*Section, char \*Key, const char \*format, ... );
      

      Could someone explain what the '...' in the parameter list means and does?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi Paul, That allows the function to accept a dynamic argument list. va_arg, va_end, va_start[^] Best Wishes, -David Delaune

      P 1 Reply Last reply
      0
      • P Paul Belikian

        I've seen functions defined as:

        int SetIniString(int nConfigSet, char \*Section, char \*Key, const char \*format, ... );
        

        Could someone explain what the '...' in the parameter list means and does?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Paul Belikian wrote:

        Could someone explain what the '...' in the parameter list means and does?

        It means that the function also accepts zero or more parameters following the last named parameter. The function will then use some information passed by the caller (in this case the %x specifications in the format string) and the va_arg[^] functions, to access the extra parameters.

        P 1 Reply Last reply
        0
        • L Lost User

          Hi Paul, That allows the function to accept a dynamic argument list. va_arg, va_end, va_start[^] Best Wishes, -David Delaune

          P Offline
          P Offline
          Paul Belikian
          wrote on last edited by
          #4

          Thank you David, for the explanation and link!

          1 Reply Last reply
          0
          • L Lost User

            Paul Belikian wrote:

            Could someone explain what the '...' in the parameter list means and does?

            It means that the function also accepts zero or more parameters following the last named parameter. The function will then use some information passed by the caller (in this case the %x specifications in the format string) and the va_arg[^] functions, to access the extra parameters.

            P Offline
            P Offline
            Paul Belikian
            wrote on last edited by
            #5

            Thank you too Richard, I appreciate your response!

            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