What does the following code snippet demonstrate? #include…
What does the following code snippet demonstrate? #include struct point { int x; int y; }; struct point doSomething(int x, int y) { struct point p; p.x = x; p.y = y; return p; } int main() { struct point p = doSomething(7, 8); printf(“%d %d\n”, p.x, p.y); return 0; }
Read DetailsWhat will be the output of the following code snippet? #inc…
What will be the output of the following code snippet? #include struct point { int x; int y; }; void doSomething(struct point *p) { p->x = 10; p->y = 20; } int main() { struct point p = {1, 2}; doSomething(&p); printf(“%d %d\n”, p.x, p.y); return 0; }
Read Details