struct info
{
int val;
};
void copy(struct info ** dst, struct info * src)
{
*dst = (struct info *)malloc(sizeof(struct info));
**dst = *src;
}
int main()
{
struct info *a, *b;
a = (struct info *)malloc(sizeof(struct info));
a -> val = 7;
copy( , );
a -> val = 9;
printf("%d", b->val);
}
I have tried (b, a)
, (*b, *a)
, (b, *a)
and so one but the argument is always unexpected by the compiler. Have been trying for an hour with no result - just a half melted brain.