this is merely out of curiosity,

i have read a couple of articles recently on the arguments that get parsed/passed(?) by int main , and some of the situations where these arguments are filtered/checked and a relevant process is invoked....

what i haven't been able to read anywhere, is how a app can send arguments to int main when when the application starts up or during application runtime, or if this is possible, or how these arguments arise in argc argv. from what i read, a file could be one of the arguments, how does this file land up there, say for instance i open and read a file in a program, does this automatically become one of the arguments, or is a file specifically run from a command line argument......

i dont really understand this, but i hope my questions are clear enough to get the correct answers.