C - Constants in printf
Hello,
I'm trying to set a minimum number of fields to write an integer variable in C. I know it can be done this way: "printf(" %05d\n",13)" stdout: "00013" I wonder if there is a way for me to do the same thing using a constant? If I declare a constant (" #define CONST 5"), can I use it in my printf in order to generate the same result? |
use the *
Code:
#include <stdio.h> |
Thank you very much. It worked really well.
|
All times are GMT -5. The time now is 05:48 PM. |