P
polas
Hello all - I have a question which is perhaps a little unusual. I am
creating a language translator which uses C as the target language. In
C, when calling a function and passing variables as arguments in, I
wish to pass a pointer of the variable to the function. However, due
to internals of the language translator it will be difficult to mark
when variables are in fact pointers and need a * prefix. I was
therefore wondering if there is a way to pass a pointer but refer to
the contents of the memory location it points to as if the pointer
were that location. For example
void examplefn (int * me)
{
me=me + 1;
}
I would like the above function to add one to the integer value held
in the memory location pointed to be "me" rather than the pointer
address as the above does at the moment.
Cheers,
Nick
creating a language translator which uses C as the target language. In
C, when calling a function and passing variables as arguments in, I
wish to pass a pointer of the variable to the function. However, due
to internals of the language translator it will be difficult to mark
when variables are in fact pointers and need a * prefix. I was
therefore wondering if there is a way to pass a pointer but refer to
the contents of the memory location it points to as if the pointer
were that location. For example
void examplefn (int * me)
{
me=me + 1;
}
I would like the above function to add one to the integer value held
in the memory location pointed to be "me" rather than the pointer
address as the above does at the moment.
Cheers,
Nick