|
-
October 1st, 2001, 02:08 AM
#1
what is (...) in a function decleraiton?
Hi All
what is (...) in a function decleraiton?
e.g.
int __cdecl printf(const char *, ...);
is it standard C?
can i declare a function that can
accept diffrent number of argument in standard C (not C++)?
thanx
-
October 1st, 2001, 03:26 AM
#2
Re: what is (...) in a function decleraiton?
Yes. See MSDN: "va_arg, va_end, va_start".
Regards,
S. Bro
/* I would be happy to deal with my problems one at the time if they would only line up! */
-
October 1st, 2001, 08:53 AM
#3
Re: what is (...) in a function decleraiton?
You might want to take a look at this MSDN article:
"Reduce EXE and DLL Size with LIBCTINY.LIB"
It gives instructions for writing your own "printf" function (see "Figure 2") to reduce the size of your executable (or DLL) and uses the variable argument list.
Regards,
S. Bro
/* I would be happy to deal with my problems one at the time if they would only line up! */
-
October 3rd, 2001, 12:51 AM
#4
Re: what is (...) in a function decleraiton?
The (...) is called an elipse and indicates that the function takes a variable number of parameters.
It is standard "C".
Look at va_start, va_end, va_sprintf, etc as covered by one of the other replies.
-
October 3rd, 2001, 07:40 PM
#5
Re: what is (...) in a function decleraiton?
BTW - here is one of the differences between C & C++ - in C Foo()
means any params, for no params we should use Foo( void )
in C++ Foo()
means NO PARAMS exactly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|