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

  • Home
  • SEARCH
  • 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 9046153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:34:54+00:00 2026-06-16T11:34:54+00:00

Possible Duplicate: C/C++: Passing variable number of arguments around According to the function declaration

  • 0

Possible Duplicate:
C/C++: Passing variable number of arguments around

According to the function declaration manner

return-type function-name(parameter-list, ...) {body ...}

Is the following code a kind of overloading?

(in A_FILE.h)

typedef VOID *FUNCTION(UINTN Number, ...);

It seems that I could just pass one Number parameter, or more parameters into the FUNCTION function, so does the number of parameters depends on the function implementation?

  • 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-06-16T11:34:58+00:00Added an answer on June 16, 2026 at 11:34 am

    The ellipsis within a function declaration means that it will accept a number of arguments otherwise, variable parameters that are unknown at run-time, which by using the standard header file stdarg.h, the respective functions in that header file ‘stdarg.h’ can determine what each of the variable parameters are that makes up the argument passing into a function.

    Consider this code example:

    #define PANIC_BUF_LEN 256
    void panic(const char *fmt, ...){
        char buf[PANIC_BUF_LEN];
        va_list argptr;
        va_start(argptr, fmt);
        vsprintf(buf, fmt, argptr);
        va_end(argptr);
        fprintf(stderr, buf);
        exit(errcode);
    }
    

    Typical invocation can be one of example:

    panic("Error: %s failed! Due to unknown error, message is '%s'\n", "my_function", "Disk not ready");
    

    Will produce an output on console in this manner:

    Error: my_function failed! Due to unknown error, message is 'Disk not ready'
    

    Notice the usage of how the functions va_start(...), va_end(...) and not to mention vsprintf(...) will take care of filling in the blanks within the “unknown” parameters provided va_list is initialized to point to the variable parameters which are unknown at run-time.

    Edit: Just to emphasize, the invocation assumes that the string parameter in the form of a C string format is less than the maximum size represented by PANIC_BUF_LEN in the above example, nit-picky aside, that is to illustrate how a function can take in a number of standard C formatting strings used, for example, one can specify %d in the string format, and expect a int to match up the parameter.

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

Sidebar

Related Questions

Possible Duplicate: C/C++: Passing variable number of arguments around Imagine I have a function
Possible Duplicate: C/C++: Passing variable number of arguments around I need to put all
Possible Duplicate: Passing arbitrary number of parameter to a function in javascript How to
Possible Duplicate: C++: Passing pointer variable to function Here is a simplified code snippet
Possible Duplicate: Passing char pointer from C# to c++ function I have this type
Possible Duplicate: Passing multidimensional arrays as function arguments in C I'm trying to use
Possible Duplicate: Understanding Python's call-by-object style of passing function arguments I recently came across
Possible Duplicate: C++ passing variables in from one Function to the Next. The Program
Possible Duplicate: Passing variable between winforms I have two forms one called Form1 the
Possible Duplicate: Passing javascript variable to PHP Hi I wonder if it's possible to

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.