Hii ,
I have written the following code to improve it for the higher datastructures .
#include<stdio.h> #include<stdlib.h> #include<malloc.h> int display(int *a , int *b , int *c) { a[0] = b; a[1] = c; printf("\n%d %d",a[0],a[1]); ------- point 1 printf("\n %d %d",*(a[0]),*(a[1])); ------- point 2 return 1; } int main() { int *a[5]; int b,c; scanf("%d %d",&b,&c); printf("%d %d",b,c); display(a,&b,&c); getchar(); }
I get the addresses in point 1 , but i dont get the values in point 2....What have i done wrong ... If my program itself is wrong , please jus give me a sample code that can dereference an array of pointers to get the value pointed by the element of array...