Re: [Dev-C++] Three dots in function prototypes
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-08-28 14:54:17
|
A variable number of parameters. The most common use is the printf() class of functions, where the parameter immediately before the ellipsis (the three dots) is a formatting string, specifying how many parameters that will follow, and of what type they are. However, you might write your own functions doing just about anything. An example: int int_sum(int count,...); void vec_add(Vec& res,int count,...); However, the use of an ellipsis is most useful when the individual "extra" parameters have varying types, since the above two examples could have been modified to have two parameters - a count and an array of integer or Vec items. The functions need to use the macros va_start(), va_arg(), and va_end() to walk through the extra parameters. However, the function never know how many parameters and of what type it has received. It is completely up to he caller to adhere to expected behaviour. /Per W On Sat, 28 Aug 2004 ab...@el... wrote: > Dear users, > > Reading the function prototypes in, for example, wchar.h, I saw the > following line: > > int wprintf (const wchar_t*, ...); > > Anybody knows what is the meaning of theese three dots? > > Regards > Andre Barros > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |