Thanks, Hans. Strange is the word for it. So far the statement char* pS; gets me an error, "identifier is already used in this scope" which is bS, because that is the only place in the program it appears. Now, char* pS; is declaring a variable which is a pointer??? I'm having quite a bit of trouble figuring out how *pS++=C; somemehow assigns anything to the array Array[20]. Shouldn't there be a #byte statement in there somewhere ... ? So far, the best I can tell you about pointers is, randomly put stars in your code, and eventually you'll find a combination that prints a string. (ugh). -- Lawrence ----- Original Message ----- From: "Hans W" To: Sent: Friday, July 20, 2001 12:07 PM Subject: Re: [PIC]: Tied up with String: OR the String Cheese Incident > Bob, > True CCS does not doe sprintf(), however they have a variation of printf() > it's a bit strange to setup it goes like this > > char* pS; > char Array[20]; // length your choice > > void MakeString(char c) // name this function to anything you like > { > *pS++ = c; > } > > Somewhere where you need it, make a call to printf like this > > printf( MakeString,"This is the string"); > > The Array now contains the string "This is the string" > > It's handy for converting floats > > float fVar ; > fVar = 123.456; > printf( MakeString,"%f", fVar); > > Array now contains the ascii of float value 123.456; > > May be this has been covered before, I expect it has, hope it helps; > > Hans W > > > > Bob Barr wrote: > > > Lawrence Lile wrote: > > > > > >+AD4- The function you're looking for here is 'sprintf'. It takes the > > >general > > >+AD4- form: > > >+AD4- > > >+AD4- sprintf(string1, +ACIAJQ-d+ACI-, Hours)+ADs- > > >+AD4- > > >+AD4- See your docs for details on additional formatting options. It > > >'prints' > > >the > > >+AD4- value to the string and has the same options as 'printf'. > > > > > > > > >Hmmm. CCS doesn't seem to recognize sprintf. Anybody got any code for > > >this > > >one? > > > > > > > AARGH!!! > > > > Sorry about the error on my part. I ASSumed that your compiler supported > > sprintf. (I don't think that I've ever seen a compiler with printf support > > that didn't include the sprintf variant.) > > > > Now, if you will excuse me, I have some egg that I need to remove from my > > face. > > > > Regards, Bob > > > > BTW, is there some setting in your mail program that mangles characters? > > Your subjects show up with '+AF' stuff instead of the brackets around the > > PIC topic tag. > > > > _________________________________________________________________ > > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > > > -- > > http://www.piclist.com hint: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu