I am currently writing a program to run on a Microchip PIC18 MCU. I use xc8 (v1.45 -I have to use this version-) compiler and working in MPLAB IDE. In this version of the compiler, there is no 64-bit integer support. I need to use 64-bit integers for some calculations. Please see my method below to create 64-bit integer variable type. But whenever I try to convert any other variable type to this newly created typte I got this error:
error: cast to union type from type not present in union
Could you please help me to fix this problem?
I have tried to use "long long int" variable but, this version of xc8 doesn't support it.
#include <stdio.h>
#include <stdint.h>
typedef union
{
int32_t bigInteger[2];
}myInt64;
int main(void) {
myInt64 *myVariable;
myInt64 *aaa;
long abc = 0xFAC0ED12;
aaa = (myInt64)abc;
myVariable = 0xF0000000000000000F;
printf("%jx", aaa);
return EXIT_SUCCESS;
}