Ok, just a really simple question which I cant seem to get the answer from.
Just a very simple program, I'm using Visual Studio 2010, C++
//prog.exe
int age;
cin>>age;
cout<<"My age is "<<age<<endl;
Of course when I run it it is fine. However, what if I want to take the .exe, for example, and place it on the desktop and run it from there?
What I want:
C:/Desktop/prog 7
My age is 7
What I am getting:
C:/Desktop/prog 7
(I have to enter 7 here again)
My age is 7
Question: How do I make it that the parameter after the program is cin as the first variable?
Thank you guys.
Popular Topics
Advertisement