Message-Id: <199711082153.QAA22413@delorie.com> From: "sl" To: "DJGPP mailing list" Date: Sat, 08 Nov 97 16:58:25 Reply-To: "sl" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Program with functions Precedence: bulk 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