Hey guys
I am working on an OS at the moment having troubles with pointers. I have a function that only returns an int, I cannot change this, and I need to return a data structure with it. Currrently I am returning the address of the data structure;
Code:
int func() {
......
......
return (int)&data_struct
}
The problem i have is how to get a data structure pointer to point to the value of an integer.
Code:
int addr = func();
ps_t *ps_ptr;
ps_ptr = ????
I need to get ps_ptr to point to the address that is the intergers value
for example if addr = 0x1234, how can I get the pointer to point to this memory location
any help would be greatly appricated
- malkav