Original Post
I have been having some trouble understanding the implementation of command line arguments. The tutorials that I read on google help, but can't realy answer my questions.
#include <iostream>
using namespace std;
int main(int argc,char *argv[])
Now from what I understand, the argc will check to see how many arguments are there, so if I were to type into my dos prompt app.exe -a -b -c it would see 3 arguments correct because the app itself doesnt count as an argument.Now, the argc is what is checking this right? Now, the big thing that I am having trouble comprehending is, is *argv[] checking what each of the commands is? For instance, say I had an app called math. The variables were set in the program to be 10 and 10. So say I called math.exe from my command prompt and added -a for add so... math.exe -a would come out to 20. How do I check within my program to see that I called -a? Is that were *argv[] comes in? This is what has been confusing me.