What will be the output of the following C program when compiled and executed on a 32-bit...
Cisco technical mcq question, verified with a worked answer. Free to practise - no sign-up.
What will be the output of the following C program when compiled and executed on a 32-bit platform?
#include <stdio.h>
void foo(char *p)
{
printf("[p= %u, *p= %u]", sizeof(p), sizeof(*p));
}
int main(void)
{
foo(0);
return 0;
}
Show answer & explanation
Answer: A. p=1, *p=1
Accurate technical and quantitative evaluation based on foundational principles.
Step-by-step Derivation:
Step 1: Formulate problem conditions.
Step 2: Apply logical deduction.
Step 3: Conclude correct option.