I'm having trouble getting some arguments to work from the command line. A
program I have excepts three arguments: "pgm argA argB argC. The first two
arguments are filenames the last is an integer. I am having no trouble with
the first two however the third is giving me some trouble. If I enter the
value '3' as the third argument and cout it it displays '3' on the screen.
However, I need to use it as an integer and if I try to cast it as an
integer I get the number '-1073743214'. Does anybody no how to fix this or
what the problem might be? I've tried a number of different castings. I
understand that the arguments value is a 'char *' my main looks like this.
int main(int argc, char* argv[])
{
stuff
}
I pass it to a function
cksum(argv[2],(int)(argv[3]));
I get no errors just the tainted value. Any suggestions?
Thanks
~Justin