I am writing a program to take 3 command line arguments and perform simple arithmetic. The second argument is the operator, and the first and third are operands. They all work fine except for the asterisk. It is converted to a list of files in the current directory. I am working under the command line in Windows XP. Does anybody know of a way to fix this problem and have an asterisk just represent an asterisk? Thanks.
Code:#include <iostream> using namespace std; int main(int argc, char* argv[]) { for (int i = 0; i < argc; i++) { cout << argv[i] << endl; } return 0; } /* Test Run: c:\test>test.exe 5 * 8 test.exe 5 test.cpp test.exe 8 where test folder contains test.cpp and test.exe */