Mail Archives: djgpp/1997/11/08/16:54:37
Hi,
I'm experiencing problems using functions. For the last while I've been using:
char *add(char *first, char*second)
{
int result;
result=first+second;
return(result);
}
Problem is that RESULT is a local variable and when you return it it gets destroyed before it reachs
the caller (because it is a local variable and naturally all local variables are destroyed when the function is
complete.) So, how am I suppose to make this function work? In reality, the REAL function I'm working on is:
"File.getname(BYTE mode)" whereby File is a class and getname() returns different components of the
filename depending on MODE (i.e. name, extention, drive etc.)
Gili
- Raw text -