I usually use printf("%-8d",a); for example for 8 spaces after (and including) an integer.
My code:
#include <stdio.h>
#include <string.h>
int main()
{
int a = 10;
char b = "Hello";
}
How can I print: '#10-Hello '
with 16 spaces (8 is the integer and the string, and 8 spaces after)?
char b = "Hello"is a syntactic error, use array of char instead' ') but any characters in the output.#a-bin a 16-character field with space padding.