Maestro
April 28th, 2003, 07:51 AM
Hi!
I use standard C.
I have a function that has a text(char*) parameter.
In the function I alter this text, and sometimes the size of the text grows. I have to return this altered text, but I get access violation.
Before I call the function I use malloc to allocate memory for the text.
How should I return the altered text when I want it in the function arguments(1. using the same input text variable, 2. with another argument), not as return value?
How and where should I allocate memory for the altered text?
Thanx
I use standard C.
I have a function that has a text(char*) parameter.
In the function I alter this text, and sometimes the size of the text grows. I have to return this altered text, but I get access violation.
Before I call the function I use malloc to allocate memory for the text.
How should I return the altered text when I want it in the function arguments(1. using the same input text variable, 2. with another argument), not as return value?
How and where should I allocate memory for the altered text?
Thanx