-2

I need to

printf(%?d)

Where '?' is some int. How can I do it? I'm using pure c. I've tried to work with const char* array. But there was no result.

1 Answers1

1

See the printf man page:

int width = 16;
int value = 42;
printf("%*d\n", width, value);

Output:

              42

LIVE DEMO

Paul R
  • 208,748
  • 37
  • 389
  • 560