30/09/2018, 16:18

Poll: Kiểm tra kiến thức C - 4.12

Let’s have a discussion about this problem and get the answer here http://www.indiabix.com/online-test/c-programming-test/14
15.What will be the output of the program?

#include<stdio.h>
int fun(int **ptr);

int main()
{
    int i=10;
    const int *ptr = &i;
    fun(&ptr);
    return 0;
}
int fun(int **ptr)
{
    int j = 223;
    int *temp = &j;
    printf("Before changing ptr = %5x
", *ptr);
    const *ptr = temp;
    printf("After changing ptr = %5x
", *ptr);
    return 0;
}
  • A. Address of i , Address of j
  • B. 10223
  • C. Error: cannot convert parameter 1 from ‘const int **’ to ‘int **’
  • D. Garbage value
Bài liên quan
0