Se ho capito bene quello che vuoi fare ti basta guardare nell'array argv[]...
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum