i have following code
#include <iostream>
using namespace std;
int main(int argc,char arg[]){
int a=arg[1];
int b=arg[2];
int c=a+b;
cout<<c<<endl;
return 0;
}
i am using windows 7 microsoft visual c++ 2010
how run it from command line?
Navigate to the directory where the executable (.exe) is located. Then type the executable’s name followed by two integer parameters.
The problems in your original example are corrected here: