You can use the following technique:
printf("%.*s", 5, "=================");
This will print "====="
It works for me on Visual Studio, no reason it shouldn’t work on all C compilers.
More Related Contents:
- C: Weird conditional printf behavior [closed]
- Function does not return printf
- Please explain the difference in the printfs below
- decimal of numbers in c
- Why does printf not flush after the call unless a newline is in the format string?
- Printing leading 0’s in C
- printf format specifiers for uint32_t and size_t
- printf adds extra `FFFFFF` to hex print from a char array [duplicate]
- call printf using va_list
- What is the argument for printf that formats a long?
- Behaviour of printf when printing a %d without supplying variable name
- Why is printf with a single argument (without conversion specifiers) deprecated?
- using printf to print out floating values
- How to use “zd” specifier with `printf()`?
- Unsigned values in C
- How to combine two 32-bit integers into one 64-bit integer?
- Centering strings with printf()
- Passing too many arguments to printf
- printf with “%d” of numbers starting with 0 (ex “0102”) giving unexpected answer (ex ‘”66″)
- Wrong format specifiers in scanf (or) printf
- Using printf with a non-null terminated string
- What primitive data type is time_t? [duplicate]
- printf string, variable length item
- Does C have a string type? [closed]
- Is it possible to print out only a certain section of a C-string, without making a separate substring?
- Printf long long int in C with GCC?
- cross-platform printing of 64-bit integers with printf
- What precisely does the %g printf specifier mean?
- Printf without newline in assembly
- In C how do I print filename of file that is redirected as input in shell