thnks for the info...seems that the term is a bit too vague and does not neccesarily mean a pointer to a pointer....go google!!
So you mean I should instead pass to this function a pointer to...
Type: Posts; User: aijazbaig1
thnks for the info...seems that the term is a bit too vague and does not neccesarily mean a pointer to a pointer....go google!!
So you mean I should instead pass to this function a pointer to...
By mallocing the memory and then copying the string do you mean I should first allocate space for the string and the pass the memory head as a pointer to the function right?
What exactly do you...
thnks for the reply,
newptr = malloc(newsize);
if (newptr != NULL)
{
memcpy(newptr, oldptr, MIN(oldsize, newsize));
free(oldptr);
}
...
well..
I may have to use C latter in school or my thesis work to handle low level stuff and Ive heard that C is better than C++ on such low level stuff...
Perhaps isn't such problems intersting...
You mean the first time I used the realloc function it allocated for me a part of the memory from the stack and not the heap (as function calls are locally allowed to use resources from the stack...
hmmm..
yea it sure is...but then one has to know the size before hand...
but Im trying to experiment with the idea of 'dynamic strings in C' ....I could instead use a bufffer big enough or I...
Hello there,
I am trying to implement a custom gets function which would allow me to read a string so as to avaoid the pitfalls associated with the C version of 'gets'.
Well...I have been able to...
well....
they are not the same if you care about the specifics.
A char pointer is a variable. It can be the lvalue of an expression while the name of an array is a constant. So it cannot be the...
Hello,
I wanna illustrate the difference between a char array (a string that is) and a pointer to char using a simple function which say capitalizes all the letters of a given string.
To that...