Mail Archives: djgpp/1999/03/13/01:52:29
I have never quite figured out how to pass a pointer to a function and have
the function update the variable sent to it. So, for many years I have
just found ways to work around this little glitch in my memory. Now, I
have come to a point in a program that I'm writing where I can't work
around the problem anymore.
Here is what I want to do:
// Read a line of text from buffer in memory and return string
char *LineInput(char *src)
{
char *dest, src2;
src2 = src;
...
[update input pointer (src) with src2]
return dest;
}
So, how would I go about doing this? That is, how would I call the
function and how would I perform the update?
Thomas J. Hruska -- shinelight AT detroit DOT crosswinds DOT net
Shining Light Productions -- "Meeting the needs of fellow programmers"
http://www.geocities.com/SiliconValley/Heights/8504
http://click-on.to/shinelight
- Raw text -