#include<stdio.h>
void myalloc(int **b)
{
*b=malloc(sizeof(int));
**b=10;
printf("**b=%d\n",**b);
}
main()
{
int *a;
myalloc(&a);// is this convention is correct?
printf("*a=%d\n",*a);
}
i have not initialised *a. can i pass the &a(address of a pointer) without initialising it. Please look at my small program and help me out. is it a proper way of pass by reference in case of pointers?