|
-
February 24th, 2011, 09:16 PM
#4
Re: Quick parameters question
Yes, in C++ (and we are in a C++ forum here), always all parameters are passed. They may, however, have values that actually mean "nothing" like the NULL passed as hPrevInstance to WinMain(). But that does not necessarily mean that all parameters need to be specified when you call the function: Functions can have parameters with default values, like e.g. all the parameters of the CFileDialog constructor except the first one. Parameters with default values that are omitted when you write the function call are implicitly passed by the compiler for you, so that the function always ends up getting all its parameters.
In C (and that includes some library functions that may be called from a C++ program as well), however, this is another story: Some functions may indeed be called with more or less parameters. But as this isn't really C++ I'll leave it out here for brevity.
And there's also function overloading (a C++ concept, to clarify) that may result in various equally named functions with differing numbers of parameters. But every one of these individual functions is always called with all its respective parameters so this is no exception to the above.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Tags for this Thread
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
|