a.c
#include "b.h"
typedef struct line_details {
int line_num;
char type[20];
} line_details;
line_details* ptr = NULL;
ptr = (*line_details) malloc(sizeof(line_details));
int x = 5;
do_something(x, &ptr);
b.c
void do_something(int n, line_details* ptr)
{
/* some code */
}
b.h
void do_something(int n, line_details* ptr);
I want to pass to function do_something
the address of the pointer and not just the copy of the pointer. When I do so, i get incompatible pointer type error
. Why?