[En-Nut-Discussion] Passing String between Function and Prog_char

iVesWorking ivesworking at hotmail.com
Wed Jun 30 12:00:36 CEST 2004


i Had some problem of passing string from on function to the other. 
the case is like this

char *FunctionA(int a){
static prog_char line1 = "a";
static prog_char line2 = "a";
char *temp;
if (a==1)strcpy_P(temp,line1);
return temp;}

char *FunctionB(int a){
static prog_char line1 = "a";
static prog_char line2 = "a";
char *temp;
if (a==1)strcpy_P(temp,line1);
return temp;}

char *functionC(void){
char *temp1; 
char *temp2; 
char *temp3="hello world";
strcpy_P(temp1,FunctionA(1));
strcat(temp1,temp3);
strcat_P(temp1,FunctionB(1));
return temp1;
}


The real case the string are longer, but total length was around 30-100 char
anyone have this problem ? or know why this happen ?
or it was work flawless on your machine ?
i using Gcc compiler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20040630/644c4a2b/attachment.html>


More information about the En-Nut-Discussion mailing list