I have 3 files
a.h
:
Struct a{ int I;}
b.c
:
#include "a.h"
Main(){
Struct a *b= hello();
}
C.c
:
#include"a.h"
Struct a *hello(){
Struct a *c= malloc (size of *(*c));
c->I = 100;
Return c;
}
And compiling .H file first ,then c.c file then b.c file,so here when main calls hello() function and it is returning c value address is correct while I am assigning to b,it is giving wrong address ,for example c value is 0x10322345 then b is 0xffff345 like this.....