Have you tried in this way: sprintf(StringBuf, "%s", OriginalString); Tamas On 13 May 2013 20:06, Harold Hallikainen wrote: > I have a string, defined at run time, that includes standard printf escap= e > sequences (such as \t and \r). I'd like to change these back to tab and > carriage return. I tried using sprintf(StringBuf,OriginalString), but thi= s > just copied OriginalString to StringBuf without expanding the escape > sequences. I note that the "format string" is defined as const char, so I > guess it is evaluated at compile time instead of run time (especially to > deal with a variable number of % substitutions). So, is there a standard > function to expand out the escape sequences in a run-time defined string? > Or do I have to write my own? > > THANKS! > > Harold > > > > -- > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising > opportunities available! > Not sent from an iPhone. > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .