R
Ron Blancarte
I was looking through the newsgroup FAQ for an answer to my question,
but it doesn't appear to have one.
I am working with a system that has VERY limited memory. I was
defining two buffers to pass in and out data:
unsigned char inputBuffer[100];
unsigned char outputBuffer[100];
But now it turns out I need the output buffer to be larger under
certain cases. What I wanted to do was make the output buffer double
size:
unsigned char outputBuffer[200];
And then use the input buffer as a portion of outputBuffer:
unsigned char *inputBuffer = outputBuffer + 100;
When necessary, the outputBuffer could then use the large array and
inputBuffer would have it's space as well, without having to allocate
the extra 100 bytes for the outputBuffer.
So I made this change, however, now input is not working. I would
have thought subscripting that was existing in code would still work.
My code all uses inputBuffer[location] as means of accessing the
inputBuffer.
So my question is, what am I doing wrong?
RonB
but it doesn't appear to have one.
I am working with a system that has VERY limited memory. I was
defining two buffers to pass in and out data:
unsigned char inputBuffer[100];
unsigned char outputBuffer[100];
But now it turns out I need the output buffer to be larger under
certain cases. What I wanted to do was make the output buffer double
size:
unsigned char outputBuffer[200];
And then use the input buffer as a portion of outputBuffer:
unsigned char *inputBuffer = outputBuffer + 100;
When necessary, the outputBuffer could then use the large array and
inputBuffer would have it's space as well, without having to allocate
the extra 100 bytes for the outputBuffer.
So I made this change, however, now input is not working. I would
have thought subscripting that was existing in code would still work.
My code all uses inputBuffer[location] as means of accessing the
inputBuffer.
So my question is, what am I doing wrong?
RonB