Hi all, I have a program that prints out the first 15 elements of an array. So far I have it so I set to a variable that is the starting pt. For example, say I have it as,
int num=10 the the array will print out 10-24 on each on its own line starting with num or 10.
Now I am trying to implement the command line. How do I go about setting num=argv[1] for example where argv[1] is the first argument i enter as an integer that i want the array to start at when printing out?
This is what i enter:
program 15 20
and i want it to print 2 arrays, one starting at 15 and the other at 20 for instance . I have the loops down but am having trouble converting that argv to a integer if you know what i mean.
Any ideas?
i tried int num=(int)argv[1] but this wouldn't compile nicely
thanks for any help you guys can offer on this
int num=10 the the array will print out 10-24 on each on its own line starting with num or 10.
Now I am trying to implement the command line. How do I go about setting num=argv[1] for example where argv[1] is the first argument i enter as an integer that i want the array to start at when printing out?
This is what i enter:
program 15 20
and i want it to print 2 arrays, one starting at 15 and the other at 20 for instance . I have the loops down but am having trouble converting that argv to a integer if you know what i mean.
Any ideas?
i tried int num=(int)argv[1] but this wouldn't compile nicely
thanks for any help you guys can offer on this