closed by
352 views
0 votes
0 votes
closed as a duplicate of: const pointer
The output of below code is_______________.

int main()
{
   int i = 120;
   int *a = &i;
   foo(&a);
   printf("%d ", *a);
   printf("%d ", *a);
}
void foo(int **const a)
{
  int j = 210;
  *a = &j;
  printf("%d ", **a);
}
closed by

Related questions

3 votes
3 votes
1 answer
1
Hira Thakur asked Jun 14, 2017
759 views
The output of below code is_______________. int main() { int i = 120; int *a = &i; foo(&a); printf("%d ", *a); printf("%d ", *a); } void foo(int const a) { int j = 210; ...
2 votes
2 votes
3 answers
3
0 votes
0 votes
1 answer
4
Debargha Mitra Roy asked 2 days ago
42 views
#include <stdio.h int main() { int a[3] = {1, 3, 5, 7, 9, 11}; int *ptr = a[0]; ptr += sizeof(int); printf("%d", *ptr); return 0; }(Assume size of int to be $2$ bytes.)T...