-
September 1st, 2010, 10:09 PM
#1
function with ... as its parameter?
Any one know what is means by
void Log(int nLevel,LPCTSTR lpszFormat,...)
{
}
May I know what can ... inside the above function refering to?
-
September 2nd, 2010, 12:31 AM
#2
Re: function with ... as its parameter?
This is the same as printf parameters. Number of parameters is defined by format specifiers in the lpszFormat.
-
September 2nd, 2010, 02:01 AM
#3
Re: function with ... as its parameter?
You can use va_start() to initialize variable argument list pointer and then va_arg() to get next argument in variable argument list.
Refer http://msdn.microsoft.com/en-us/libr...d8(VS.71).aspx for example.
Last edited by funwithdolphin; September 2nd, 2010 at 02:03 AM.
There are 10 types of people in this world, those who understand binary and those who do not!!
-
September 2nd, 2010, 04:29 AM
#4
Re: function with ... as its parameter?
Thanks to Alex F.
Also thanks to funwithdolphin for showing me a clear example.Now I know how to use it. Thanks again.
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
|