• closed by
841 views
0 0 votes
#include <stdio.h>
void foo(int[][3]);
int main(void)
{
    int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
    foo(a);
    printf("%d\n", a[2][1]);
    return 0;
}
void foo(int b[][3])
{
    ++b;
    b[1][1] = 9;
}

(a) 8 (b) 9 (c) 7 (d) none of the above

Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
994
994 views
Desert_Warrior asked May 16, 2016
994 views
#include<stdio.h #include<stdlib.h int main() { char s[] = "Opendays2012"; int i = 0; while(*(s++)) i++; printf("%d",i); return 0; }(a) Segmentation Fault (b) Compile Err...
1 1 vote
1 answers 1 answer
2.9k
2.9k views
Desert_Warrior asked May 16, 2016
2,917 views
#include<stdio.h void foo(char *); int main() { char *string = "Hello"; foo(string); printf("%s",string); return 0; } void foo(char *a) { while(*a) { *a += 1; a++; } }(a)...
0 0 votes
1 1 answer
757
757 views
Desert_Warrior asked May 16, 2016
757 views
#include <stdio.h int main(void) { char a[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&a + 1); printf("%d %d\n", *(a + 1), *(ptr - 1)); return 0; }options are : (a) Compi...
0 0 votes
2 answers 2 answers
2.2k
2.2k views
Desert_Warrior asked May 16, 2016
2,223 views
#include<stdio.h int main() { int a[10][20][30]={0}; printf("%ld",&a+1 - &a); return 0; }