typedef long int comparison
Hello,
I have a library which typedefs a long int
Code:
//from tpd1.h
typedef long int Int
and there is another library which also typedefs a long int
Code:
//from tpd2.h
typdef long int integer
There is a function from the second library which should receive a integer*, but i have to give it a Int*. It won't accept (invalid conversion).
To add it in my .cpp, I use
Code:
#include "tpd1.h"
extern "C" {
#include "tpd2.h"
}
because tpd2.h have some things from Fortran.
These won't work:
Code:
Int i;
integer j;
Int *pi = &j; //wont work
integer *pj = &i; //wont work
but the following will
Code:
Int *pi = (Int *) (&j); //will work
integer *pj = (integer *) (&i); //will work
Anyone can't tell me why they implicitly convert, and how to make them do it.
Thank you,
Nepper271