Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What this declaration stands for ??

Status
Not open for further replies.

parbhani

Technical User
Jul 3, 2002
125
GB
Hi all,

I am on Solaris. One of the C codes (Pro*C) we have has following declaration statement,

int (*dbg_print) (const char *fmt_str,...);

What is the meaning of this ? I can make out that this is pointer to function. But what the three dots "..." stand for ?

Please explain.

Regards
 
Hi,

It's look like a genaric function.

three dot means greater or equal to zero parameters for this function.

If you remember the prototype of printf statement is something like this

printf(char *, ...);

if means printf function is going somthing based on first parameter which is simple string for printf.

Regards,
Amar

 
It's an ordinal pointer to function declaration, that's all.
For example, you may assign:
Code:
dbg_print = printf;
dbg_print("Format spec: %s\n",fmt_spec); /* or what else. */
It's not Solaris C specific declaration, it's a standard C declarator type (*f_ptr)(...);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top