LogiQuest
Back to Structures, Unions, Enums
11

What will be the output of the program?

#include <stdio.h>
struct S { int x; };
void set(struct S *s) { s->x = 100; }
int main(void) {
    struct S v = {5};
    set(&v);
    printf("%d\n", v.x);
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.