I declare my struct in a header file like so:
typedef struct MyStruct{
int test;
} MyStruct;
@interface StructTestingFile
MyStruct *originalStruct;
@end
Then from the .mm file, I call
originalStruct = loadTestInt();
In the C file, here is what I'm doing:
extern "C" MyStruct* loadTestInt()
{
MyStruct *aStruct;
aStruct->test = 1;
return aStruct;
}
Every time it crashes on assigning aStruct->test = 1. What am I doing incorrectly?