C++ Question
I am trying to get numbers from the command line as arguments. Just to try it out I did something like:
int main(int argc, char* argv[])
{
int a = (int) argv[1];
int b = (int) argv[2];
int c = a + b;
//etc...
}
Only problem is, this didn''t work. Any suggestions how to do this? The usage is something like ''program .
Thank You,
pigsfl3w
Try this ...
int a = atoi(argv[1]);
int b = atoi(argv[2]);
int c = a + b;
int a = atoi(argv[1]);
int b = atoi(argv[2]);
int c = a + b;
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement