Click here to Skip to main content
15,917,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRuntime error Pin
si_695-Aug-03 1:09
si_695-Aug-03 1:09 
GeneralCreating Outlook Express button Pin
beside5-Aug-03 0:44
sussbeside5-Aug-03 0:44 
GeneralRe: Creating Outlook Express button Pin
Eugene Pustovoyt5-Aug-03 1:57
Eugene Pustovoyt5-Aug-03 1:57 
GeneralRe: Creating Outlook Express button Pin
beside5-Aug-03 2:21
sussbeside5-Aug-03 2:21 
GeneralVariable number of arguments... Pin
Anonymous5-Aug-03 0:33
Anonymous5-Aug-03 0:33 
GeneralRe: Variable number of arguments... Pin
Ryan Binns5-Aug-03 0:41
Ryan Binns5-Aug-03 0:41 
GeneralRe: Variable number of arguments... Pin
Ted Ferenc5-Aug-03 0:47
Ted Ferenc5-Aug-03 0:47 
GeneralRe: Variable number of arguments... Pin
HPSI5-Aug-03 0:55
HPSI5-Aug-03 0:55 
Anonymous wrote:
If I have to do this, how does printf() avoid it?

printf() avoids it by not caring. It assumes that you are passing the same number of args as there are option switches in the format string. If you don't, printf() might crash.

So what can you do? There are basically two choices:

  1. Add a count parameter to your function:
    int average( int first, int count, ... )

  2. Do what the MSDN example does, and supply a terminator value.


p.s. Thank you for taking the effort to format your question.




HPS HwndSpy
- GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
General.Net proj Pin
Nilesh K.5-Aug-03 0:29
Nilesh K.5-Aug-03 0:29 
GeneralRe: .Net proj Pin
HPSI5-Aug-03 1:06
HPSI5-Aug-03 1:06 
GeneralLeaks font resourse at use CIpAddressCtrl Pin
Eugene Pustovoyt5-Aug-03 0:27
Eugene Pustovoyt5-Aug-03 0:27 
GeneralRe: Leaks font resourse at use CIpAddressCtrl Pin
HPSI5-Aug-03 1:00
HPSI5-Aug-03 1:00 
GeneralRe: Leaks font resourse at use CIpAddressCtrl Pin
Eugene Pustovoyt5-Aug-03 1:42
Eugene Pustovoyt5-Aug-03 1:42 
GeneralPasting DLL code into SDI workspace Pin
Member 4853715-Aug-03 0:17
Member 4853715-Aug-03 0:17 
Questionwebbrowser problem???? Pin
xxhimanshu4-Aug-03 23:57
xxhimanshu4-Aug-03 23:57 
GeneralRe: Get current logged on user Pin
Toni784-Aug-03 23:16
Toni784-Aug-03 23:16 
GeneralRe: Get current logged on user Pin
Didi735-Aug-03 0:39
Didi735-Aug-03 0:39 
GeneralRe: Get current logged on user Pin
Toni785-Aug-03 22:29
Toni785-Aug-03 22:29 
GeneralGet current logged on user Pin
Didi734-Aug-03 23:13
Didi734-Aug-03 23:13 
Generalmsdn 2003 download Pin
Abhi@Work4-Aug-03 23:09
Abhi@Work4-Aug-03 23:09 
GeneralRe: msdn 2003 download Pin
Toni784-Aug-03 23:13
Toni784-Aug-03 23:13 
GeneralRe: msdn 2003 download Pin
Abhi@Work4-Aug-03 23:19
Abhi@Work4-Aug-03 23:19 
GeneralRe: msdn 2003 download Pin
Toni785-Aug-03 22:26
Toni785-Aug-03 22:26 
GeneralRe: msdn 2003 download Pin
Bob Stanneveld5-Aug-03 8:26
Bob Stanneveld5-Aug-03 8:26 
GeneralTool bar buttons Pin
Marissa1824-Aug-03 22:29
Marissa1824-Aug-03 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.