Ask 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 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);

+1
Answers (1)
  1. 11 April, 01:19
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers