Quizzes
What is the output?
#include <stdio.h>
int i;
void func(int j, int *p, int a[]);
main()
{
int j, k, *p, a[1];
i = 1; j = 2; k = 3; p = &k;
a[0] = 0;
func(j, p, a);
printf("%d, %d, %d, %d, %d\n", i, j, k, *p, a[0]);
}
void func(int j, int *p, int a[])
{
i += 10;
j += 10;
*p += 10;
a[0] += 10;
p = &i;
}
11, 2, 13, 13, 10
Previous slide
Next slide
Back to first slide
View graphic version