|
-
April 28th, 2003, 07:51 AM
#1
Access violation
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
-
April 28th, 2003, 09:36 AM
#2
since you are using C you can use realloc in your function to resize the memory allocation for your character string.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|