About global struct pointer, Problem solved, Read me
Posted: Wed Sep 16, 2009 9:24 am
The problem I come across
Global code :
Draw Actor
a dialog will pop up and say READ error in invalid memory area
So I don't use pointer
Global code :
Draw Actor
everything is okay this time
with skydereign's help I get back to pointer
Global code :
Create Actor
Draw Actor
Global code :
- Code: Select all
typedef struct tagtest
{
int state;
} test;
test *mytest = (test*)malloc(sizeof(test));
Draw Actor
- Code: Select all
if(mytest->state);
- Code: Select all
if(((test *)mytest)->state);
a dialog will pop up and say READ error in invalid memory area
So I don't use pointer
Global code :
- Code: Select all
typedef struct tagtest
{
int state;
} test;
test mytest;
Draw Actor
- Code: Select all
if((&mytest)->state);
everything is okay this time
with skydereign's help I get back to pointer
Global code :
- Code: Select all
typedef struct tagtest
{
int state;
} test;
test *mytest;
Create Actor
- Code: Select all
mytest = (test*)malloc(sizeof(test));
Draw Actor
- Code: Select all
if(mytest->state);