I'm new to C and new to asking questions. I've read multiple topic and questions on this . If I missed a similar question I'm sorry .
I have an array that I declare in a function. I want to save the adress of the array so later i can find a value in this array from another function.
void vhf_list(int *p_util)
{
int *full_info=NULL;
full_info = malloc(60 * sizeof(int));
full_info[0]=576; //My array
full_info[1]=577;
full_info[2]=578;
full_info[3]=579;
full_info[4]=580;
full_info[5]=581;
full_info[6]=582;
/*
rest of array */
p_util=&full_info[0];
}
And going from there I want to save the adress of this array and re-use it:
void find_apid(int apid, int *p_fctn)
{
int *p_apid=NULL;
p_apid = malloc(sizeof(int));
vhf_list(p_apid);
I've read multiple question trying to grasp the pass by reference but I'm just a bit lost.