Reputation: 14008
int num = atoi(argv[1]);
unsigned long times[num];
I have this code and I assumed it won't compile because I am trying to allocate the array using a value from a command line argument, which compiler doesn't know at the compile time. But I compiled this code and it worked. Can someone explain what is going on here?? Am I misunderstanding the basic concept of static allocation??
Upvotes: 2
Views: 149