Converting cmd arg to int
I am trying to convert the first command argument from char ** to an int i can use to declare an array, but I can't figure out how to do it. Basically that user specifies the size of the array from that cmd argument.
example: person puts 10 in command argument
Code:
int main(int argc, char **argv)
{
//code here to make an:
int iArray[argv[1](or whatever) that works as int=10 or any cmd line argument] ] = {0};
}
I've tried a bunch of things like reinterpret_cast etc but all i can get is a bunch of random values in my int :(