Why not this: { char ampm[3] = "PM"; // This can be set to "AM" or "PM", depending on time int Hours, Minutes; printf( "%d:%02d %s", Hours, Minutes, ampm ); } or even this if you really want to build a string and perhaps use it elsewhere as well { char string1[20] char ampm[3] = "PM"; int Hours, Minutes; sprintf( string1, "%d:%02d %s", Hours, Minutes, AmPm ); printf( string1 ); } Lawrence Lile wrote: > > I am perpetually confused by pointers in C, thus, I avoid them whenever > possible. (I have the same method of coping with the city bus system - > don't use it) > > CCS has a number of string functions, which "return pointers" whatever that > means. What I'd like to accomplish is this: > > I want to concatenate several items into a string, then pass that string to > PRINTF and squirt it out the RS232 port. > > One of the strings might be something like "10:01 AM System ON" or " 7 28 > PM System OFF" (note the blinked colon) > > Here's a stab at it, prolly fulla bugs: > > Char string1[20]; > . > . > . > > STRCAT(string1, Hours); // of course, Hours is an INT, not a string, how to > convert to a string? > STRCAT(string1, ':'); // blinky colon > STRCAT(string1, Minutes); // minutes, also still an INT not a string ??? > STRCAT(string1, 'PM'); // does this work with a buncha letters? > etc. > Printf(*string1); // ?????????? > > Any suggestions are welcome > > -- Lawrence Lile > Sr. Project Engineer > Salton inc. Toastmaster Div. > 573-446-5661 Voice > 573-446-5676 Fax -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu