How can i declare an array like this one:
int array[1000000];
as a static array, a stack array, and a heap-allocated array?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your assignment appears to be looking for this:
Or perhaps this:
For what it is worth, unless you have a four or eight megabyte reserved call-stack (or larger), the function above will likely croak on entry. For such large sizes it is customary to use the heap (
malloc()/free()). But that is not what your assignment appears to be about (yet).