Hi,
Can anyone tell how should i use far pointers in unix.
If far pointer is not available,
Is there any other mechanism to acheive that.
Thanks
by
A.Sebasti
Hi,
Can anyone tell how should i use far pointers in unix.
If far pointer is not available,
Is there any other mechanism to acheive that.
Thanks
by
A.Sebasti
The keyword 'far' is obsoleted by 32bit integers (and thus, pointers). The word 'far' is only ever used on 16bit-integer compilers. Just use pointers as normal, and omit 'far'.
Quzah.
Hi,
Thanks for your solution.
I have tried that one also but i am not able to achive the task.
The situation is like this.
I am forking many processes.
The variable(actually the address of it) that i have created by parent process should be available to the children also.
Any approach is welcomed.
Thanks
By
A.Sebasti...
> The variable(actually the address of it) that i have created by parent process should be available to the children also.
Then you haven't understood how fork works - each process has its own address space which only "looks" identical at the moment of fork.
As soon as either process writes to their respective data spaces, they diverge, and the change is not reflected in the data space of the other process.
You need to look up shared memory if you want to do this.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.