hi
the strings you are using will be written to the stack when the function is called
then when the function returns the pointer on conpletion. That pointer will be undefined.
your probally just using those literal strings to devolop your program
you could use a string in the calling function, which would be valid
and pass a pointer to that.
Main Topics
Browse All Topics





by: ikeworkPosted on 2005-11-19 at 13:08:23ID: 15327036
hi jonny,
as the compiler says, the problem is, you return the adress of local variables in that functions,
you do probable something like this:
char* not_working_function()
{
char *locally_var = "any_string";
return locally_var;
}
this doesnt work, since the local variable is only accessable, as long as we are *inside* the function,
but an address to it is returned.
if you show us the code of that functions, we can help you better...
ike