I have a doubt @ the storage of command line arguments.
myprog.exe -cfgfile myconfig.cfg
commandline args are passed when process gets created so are they
The command line arguments are stored in the application's memory space. Exactly where differs from OS to OS, my guess is it usually goes at the bottom of the heap. The code which puts it there is in the kernel source code for exec on Unix-like OSs, not sure where it would be in Windows (not that you can see the source anyway). The C runtime code (this is where "crt" comes from) takes argv and argc from the stack and then calls main. If you are interested in learning more how an executable starts up in Linux, this paper by Ulrich Drepper (glibc maintainer) may be of value: http://people.redhat.com/drepper/dsohowto.pdf