Parameters quick Question

This is a discussion on Parameters quick Question within the C++ Programming forums, part of the General Programming Boards category; There are two types of ____ parameters: value parameters and reference parameters.? A. actual B. formal C. active D. passive ...

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

    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
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,763
    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
    Location
    Singapore
    Posts
    22,313
    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.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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, 04:48 AM
  2. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 05:44 AM
  3. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 12:04 PM
  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, 06:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21