Em 19/8/2010 13:16, Carl Denk escreveu: > This is with a 18F1320, and MCC18 V.8.53. I am trying to just format=20 > date and send it via USAart to an 4 x 20 LCD. I do have working where I=20 > use TXREG =3D to output the characters from an array, but would rather=20 > save the arrays storage. I want to output the date 10/24/10 format. =20 > Here's part of the code: > > #include > #include > #include > #include > int month, day, year; > > This works: > > printf ((rom unsigned int*)"integer output: %2u\0" ,month); The typecast on the string is weird, you shouldn't need it. Besides it is wrong, because 'printf' doesn't expect an array of 'int' as its first argument, it should be an array of char. Just leave the constant string alone. Beware: MCC18 has some bugs related to ROM and RAM pointers, it doesn't warn of some wrong pointer types usage. And you don't need to add the '\0', the compiler puts it automatically. > And this doesn't work, a first step is outputting, 2 variables, assuming= =20 > once I got that, rest will follow pattern. > printf ((rom unsigned int*)"integer output: %2u %2u\0" ,month, day); It should work, and it works for me, apart from the wrong typecast. > Thinking adding the "/" separator, might look like: > printf ((rom unsigned int*)"integer output: %2u/%2u/%2u\0" ,month,=20 > day,year); Should work OK also. > I have experimented with various casts, but apparently have found the=20 > correct way to do it. Was considering rebuilding the library as "FAR" ,=20 > but that's a different subject. Not a bad idea, see my page: Some MCC18 stuff there, perhaps the generic pointers may be useful to you. I have more code that I didn't publish. If you need some help, e-mail me off-list. Best regards, Isaac __________________________________________________ Fale com seus amigos de gra=E7a com o novo Yahoo! Messenger=20 http://br.messenger.yahoo.com/=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .