print formatted
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <stdio.h> #include <stdarg.h> int Print_Formatted (char const* format, ...); int main (void) { char* Greeting = "Hello, World!!"; printf ("String length : %d\n", Print_Formatted ("%s%c", Greeting, '\n')); return 0; } int Print_Formatted (char const* format, ...) { va_list argument = NULL; int String_Length = 0; va_start (argument, format); String_Length = vfprintf (stdout, format, argument); va_end (argument); return String_Length; } | cs |
0 개의 댓글:
댓글 쓰기