Thread: Parameters quick Question

  1. #1
    Registered User lifeis2evil's Avatar
    Join Date
    Oct 2007

    Unhappy Parameters quick Question

    There are two types of ____ parameters: value parameters and reference parameters.?

    A. actual
    B. formal
    C. active
    D. passive

    the test says the answer is A. but in the book it shows the answer as being B. so I'm really confused >_<. I'm pretty positive its B. though but if I put B. I'll get it wrong -_-

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    United States
    Both are correct, but in this context the answer is A because you are talking about the types of all possible parameters. Formal parameters, at least according to the warnings I get, are the parameters of a specific function. For example, you could say that the open function has a const char * formal parameter. When you declare a new function prototype, it probably has formal parameters, and so on.

    I'd say this is a trick question and the answer is dependent on reading comprehension. If you were me, this would confirm that learning in America is basically a lost cause, since they would prefer to ask this instead of a better question. But anyway, move on with your work.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Interestingly, if we use the definitions given by Bjarne Stroustrup's C++ Glossary:

    argument - a value passed to a function or a template. In the case of templates, an argument is often a type.

    parameter - a variable declared in a function or templates for representing an argument. Also called a formal argument. Similarly, for templates.

    I have always interpreted "actual parameter/argument" to mean "argument" and "formal parameter/argument" to mean "parameter", in the context of Stroustrup's glossary.

    Frankly, this is an ambiguous question. I consider both A and B to be correct, even in the context of "the types of all possible parameters". One can argue that formal parameters are specific to a function, but a counter argument is that actual parameters are specific to a function call.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  2. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  3. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  4. Quick Question on File Names and Directories
    By Kyoto Oshiro in forum C++ Programming
    Replies: 4
    Last Post: 03-29-2002, 02:54 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM