Output single character in C

yes, %c will print a single char: printf(“%c”, ‘h’); also, putchar/putc will work too. From “man putchar”: #include <stdio.h> int fputc(int c, FILE *stream); int putc(int c, FILE *stream); int putchar(int c); * fputc() writes the character c, cast to an unsigned char, to stream. * putc() is equivalent to fputc() except that it may … Read more

Python: Logging TypeError: not all arguments converted during string formatting

You cannot use new-style formatting when using the logging module; use %s instead of {}. logging.info(‘date=%s’, date) The logging module uses the old-style % operator to format the log string. See the debug method for more detail. If you really want to use str.format() string formatting, consider using custom objects that apply the formatting ‘late’, … Read more

VBScript: What is the simplest way to format a string?

Replace (strFormat, “{0}”, value1) Based on your code snip, I’m guessing you believe Replace mutates strFormat directly. It doesn’t work like that; You assign the result to the original variable like this: strFormat = Replace (strFormat, “{0}”, value1) You can also assign to another variable to store the changed results, like this: strFormat2 = Replace … Read more