Consider the following C function definition. int fX(char *a){ char *b = a;…
GATE · 2024 · CS · Set 2 · Computer Science & IT
Consider the following C function definition.
int fX(char *a){
char *b = a;
while(*b)
b++;
return b - a;
}
Which of the following statements is/are TRUE?
- A.
The function call fX(”abcd”) will always return a value
- B.
Assuming a character array c is declared as char c[] = ”abcd” in main(), the function call fX(c) will always return a value
- C.
The code of the function will not compile
- D.
Assuming a character pointer c is declared as char *c = ”abcd” in main(), the function call fX(c) will always return a value
Attempted by 144 students.
Sign up free to check your answer
Sign up freeLoading lesson…