Click here to Skip to main content
15,398,211 members
Home / Discussions / C / C++ / MFC

C / C++ / MFC

QuestionBitmap Planes Pin
Sarath C30-May-06 20:41
MemberSarath C30-May-06 20:41 
AnswerRe: Bitmap Planes Pin
Steve Echols30-May-06 21:57
MemberSteve Echols30-May-06 21:57 
GeneralRe: Bitmap Planes Pin
NiceNaidu30-May-06 22:52
MemberNiceNaidu30-May-06 22:52 
Question.obj, .lib and .dll? Pin
Polite Programmer30-May-06 20:40
MemberPolite Programmer30-May-06 20:40 
AnswerRe: .obj, .lib and .dll? Pin
Cedric Moonen30-May-06 21:03
MemberCedric Moonen30-May-06 21:03 
GeneralRe: .obj, .lib and .dll? Pin
NiceNaidu30-May-06 21:19
MemberNiceNaidu30-May-06 21:19 
GeneralRe: .obj, .lib and .dll? Pin
Polite Programmer31-May-06 19:15
MemberPolite Programmer31-May-06 19:15 
QuestionOptional arguments Pin
SWDevil30-May-06 20:39
MemberSWDevil30-May-06 20:39 

I have a function that is declared as follows:
void func(int A, int B, int C, int D=-1, int E=-1);
arguments D and E are optional, and so if the function is called like this:
func(A,B,C); then D and E recieve the value -1.

What I want to do is add another optional argument, let's say int F that will also receive -1 as default, for example.
The problem is that sometimes I want to call the function only with the parameters A,B,C and F. If I declare the function like this:
void func(int A, int B, int C, int D=-1, int E=-1, F);
will I be able to call the function in this manner:
func(A,B,C,,,F); ?

AnswerRe: Optional arguments Pin
Nibu babu thomas30-May-06 20:48
MemberNibu babu thomas30-May-06 20:48 
AnswerRe: Optional arguments Pin
_anil_30-May-06 21:00
Member_anil_30-May-06 21:00 
GeneralRe: Optional arguments Pin
SWDevil30-May-06 21:16
MemberSWDevil30-May-06 21:16 
GeneralRe: Optional arguments Pin
Cedric Moonen30-May-06 21:18
MemberCedric Moonen30-May-06 21:18 
GeneralRe: Optional arguments Pin
Owner drawn30-May-06 21:25
MemberOwner drawn30-May-06 21:25 
GeneralRe: Optional arguments Pin
ThatsAlok30-May-06 23:59
MemberThatsAlok30-May-06 23:59 
GeneralRe: Optional arguments Pin
Rajesh R Subramanian9-Oct-06 21:54
professionalRajesh R Subramanian9-Oct-06 21:54 
GeneralRe: Optional arguments Pin
Owner drawn16-Oct-06 19:25
MemberOwner drawn16-Oct-06 19:25 
GeneralRe: Optional arguments Pin
_anil_30-May-06 21:29
Member_anil_30-May-06 21:29 
AnswerRe: Optional arguments Pin
toxcct30-May-06 21:46
Membertoxcct30-May-06 21:46 
GeneralRe: Optional arguments Pin
SWDevil30-May-06 21:59
MemberSWDevil30-May-06 21:59 
GeneralRe: Optional arguments Pin
toxcct30-May-06 22:04
Membertoxcct30-May-06 22:04 
GeneralRe: Optional arguments Pin
ThatsAlok31-May-06 17:50
MemberThatsAlok31-May-06 17:50 
AnswerRe: Optional arguments Pin
BadKarma30-May-06 22:50
MemberBadKarma30-May-06 22:50 
QuestionWM_GETTEXT and GetWindowText [modified] Pin
HakunaMatada30-May-06 20:14
MemberHakunaMatada30-May-06 20:14 
AnswerRe: WM_GETTEXT and GetWindowText [modified] Pin
Stephen Hewitt30-May-06 20:27
MemberStephen Hewitt30-May-06 20:27 
GeneralRe: WM_GETTEXT and GetWindowText [modified] Pin
HakunaMatada30-May-06 20:31
MemberHakunaMatada30-May-06 20:31 

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.