Ask Question
28 October, 17:32

Which of the following declarations for a function is valid and legal in C++?

Select one:

a. void foo

b. All of the choices listed are valid C+ + function declarations

c. int foo (char x);

d. None of the choices listed is a valid C+ + function declaration

e. foo (int a, int b);

+2
Answers (1)
  1. 28 October, 20:07
    0
    c. int foo (char x);

    Explanation:

    Among the given options:

    int foo (char x);

    is a valid function declaration which declares a function with the name foo which takes a single character argument x and returns an integer data type.

    Option a (void foo) does not specify the arguments off the function while option e (foo (int a, int b); ) does not specify the return type. Hence these are incomplete function declarations.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following declarations for a function is valid and legal in C++? Select one: a. void foo b. All of the choices listed are ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers