I have been wondering how C's printf function worked, so I decided to look at gcc's stdio.h for the definition. To my surprise, the printf function in gcc is defined with the arguments "const char*, . . . ". I tried doing this for myself, in a simple program that I made.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int Print(const char *text, ...) {
printf("%s\n", text);
}
int main() {
Print("Hello, World!", "a");
}
I can pass however many arguments I want into it, even though those arguments won't have any future access point. I am wondering more about this, and I wish to know if anybody has more information.