Hi Thomas. Strcat takes a char * not a char. However, you can't just say: (char *)&day because you can't know that it will be zero terminated. Same for year. There are lots of ways you might do this depending on your platform. On a big computer (big being a PC or something) you might just use sprintf(): sprintf(bd_string,"%d %s %d",day,month,year); But most small computers won't like sprintf much. char *bp=bd_string; char *mp=month; if (day>=10) *bp++=day/10+'0'; *bp++=day%10+'0'; *bp++=' '; while (*mp) *bp++=*mp++; *bp++=' '; *bp++=year/1000+'0'; *bp++=(year%1000)/100+'0'; *bp++=(year%100)/10+'0'; *bp++=year%10+'0'; I didn't test that but it ought to work for years <9999. Al Williams AWC * 8 channels of PWM http://www.al-williams.com/awce/pak5.htm > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Thomas N > Sent: Friday, March 08, 2002 3:35 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [OT]: strcat in c language. Please help! > > > Hello everyone, > > Here is my short program: > void main( void ) > { > int day = 1, > year = 2002; > char month[6] = "May", > bd_string[60] = {'\0'}; > > strcat(bd_string, (char) day); > strcat(bd_string, month); > strcat(bd_string, (char) year); > } > What I am trying to do is to copy "1 May 2002" into the > string "bd_string". I try as above and it doesn't work. > Please help! Thank you! Thomas. > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads