Actually your version should have worked as well... odd.
Type: Posts; User: CommonTater
Actually your version should have worked as well... odd.
If you are going to be accepting more than single digit numbers, yes you need to assess the entire length of each string...
int i, j; // loops
int len; // length
for (i=1; i <argc;...
Your first problem is most likely on line 17 ... the contents of command line strings (argv) are ascii characters that do not convert directly to numbers... to get the integer value from an ascii...