logo

Courses with this lesson

Simple technique to understanding all 32 printf functions

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { char buf[100]; va_list args; // needs initialization printf("Example\n"); fprintf(stdout, "Example\n"); sprintf(buf, "Example\n"); snprintf(buf, 100, "Example\n"); vfprintf(stdout, "Example\n", args); return 0; }