S
Sandy
Having problem on using the -> operator in C.
aFile.C
struct _process* initProcess(void){
struct _process* tmpProcess;
tmpProcess = palloc();
tmpProcess->PID = 0;
tmpProcess->next = 0;
return tmpProcess;
}
bFile.C
initProcess()->PID =2;
I always get this error "error C2037: left of 'PID' specifies undefined
struct/union '_process'", where process is a well defined struct with memory
allocated and the member PID was assigned a value.
The initProcess was able to allocate the memory for the structure and
initialize the member values.
Where is my mistake?
Thanx
aFile.C
struct _process* initProcess(void){
struct _process* tmpProcess;
tmpProcess = palloc();
tmpProcess->PID = 0;
tmpProcess->next = 0;
return tmpProcess;
}
bFile.C
initProcess()->PID =2;
I always get this error "error C2037: left of 'PID' specifies undefined
struct/union '_process'", where process is a well defined struct with memory
allocated and the member PID was assigned a value.
The initProcess was able to allocate the memory for the structure and
initialize the member values.
Where is my mistake?
Thanx