hi,
i'm pretty new to this so sorry if this is a stupid question.
i've just learnt a little about using free() to release memory, and i'm using it to free a char* thats set using malloc.
but is there a way of freeing up memory that isn't set using malloc, for example in a function where i declare
char strSomething[25]
i tried using free(strSomething); but i got runtime errors. and also if i keep calling the same function which declares this char variable will it assign a new piece of memory each time or just overwrite the previous peice?
thanks.
i'm pretty new to this so sorry if this is a stupid question.
i've just learnt a little about using free() to release memory, and i'm using it to free a char* thats set using malloc.
but is there a way of freeing up memory that isn't set using malloc, for example in a function where i declare
char strSomething[25]
i tried using free(strSomething); but i got runtime errors. and also if i keep calling the same function which declares this char variable will it assign a new piece of memory each time or just overwrite the previous peice?
thanks.