Give an example in C code that shows and demonstrates for ea

Give an example in C++ code that shows and demonstrates for each of the three type of arrays listed below: Static Array Fixed stack-dynamic array Fixed heap-dynamic array

Solution

Examples----->

Static Array:(its used statci keyword)

static int myarray[3] = {2, 3, 4};

Fixed stack-dynamic array:(its does not use static keyword)

int array[3] = {2, 3, 4};

Fixed heap dynamic array: ( its using explicit heap allocation)

int * fixed_heap_dynamic_array = malloc(7 * sizeof(int));

 Give an example in C++ code that shows and demonstrates for each of the three type of arrays listed below: Static Array Fixed stack-dynamic array Fixed heap-dy

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site