Question: 1. Research and write below the prototype of the s… SOLVED
- Research and write below the prototype of the standard C++ function which converts a character to a lowercase form of the same character.
- In several standard C++ functions the return type often will not be what you need. What would you need to use the above function as a way to generate a lowercase character for a cout statement?
- List the two categories of user–defined functions that the book describes:
- Function prototypes and function definitions look similar because they have the same function heading. In a function prototype the heading is followed by a ___, whereas in a function definition the heading is followed by a ___.
- What are the two forms of passing arguments to a function?
- In C++ it is said that functions have only one return type. What mechanism allows programmers to work around this limitation?7. Based on the above the answer, which of the following two function prototypes makes sense to use for a function that will swap two values, the first or second?
void swap(int val1, int val2); //prototype #1
void swap(int& val1, int& val2); // prototype #2
- Write a function definition as follows: it returns the C++ form of a Boolean value, its function identifier is anyTwoTheSame, it has three formal parameters which all are floating-point values, and the body of the function returns true if any two of the parameters are equal, otherwise it returns false. I recommend using short, simple identifiers for the three formal parameters.
- (yes/no) In C++, is it legal to declare the variable int v; at the top of the body of a function and later declare char v; inside of a while loop body? (Book review question on scope.)
//example function body template