Skip to content

Instantly share code, notes, and snippets.

@qvil
Created November 5, 2017 12:04
Show Gist options
  • Save qvil/e71e72d91df4fa7dc10a3142a2831be0 to your computer and use it in GitHub Desktop.
Save qvil/e71e72d91df4fa7dc10a3142a2831be0 to your computer and use it in GitHub Desktop.
teacher-appointment-exam-2017.c
#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