Created
November 5, 2017 12:04
-
-
Save qvil/e71e72d91df4fa7dc10a3142a2831be0 to your computer and use it in GitHub Desktop.
teacher-appointment-exam-2017.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void func(int *w, int *x, int *y, int *z); | |
void main() | |
{ | |
int data[3] = {3, 70, 700}; | |
int a, sum, *pa, *pb, *pc; | |
a = 6; | |
pa = &a; | |
pb = &data[0]; | |
pc = data + 1; | |
func(data, pa, pb, pc); | |
sum = data[0] + data[1] + data[2]; | |
printf("%d", sum); | |
} | |
void func(int *w, int *x, int *y, int *z) | |
{ | |
*w = *x + 1; | |
w[1] = *(y + 1); | |
*(w + 2) = z[1]; | |
} | |
// Result : 777 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment