answersLogoWhite

0

If you mean how do you create an array with 16 elements, there are two ways:

int a[16]; /* fixed size array of 16 integer elements */

int* b = malloc(16*sizeof(int)); /* variable length array with (initially) 16 integer elements */

Remember that variable length arrays allocated on the heap must be released as soon as they are no longer required:

free (b);

b=NULL;

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

What array can you make to show the factors of 16?

You can create an array with some elements, get the factors of a number (such as 16), and while you get each of the factors, place the factors in the array. Every time you find a factor, divide the number by this factor before you search the next factor (to avoid getting the same factor over and over again).


What number between 12 and 16 have only one array?

13


Is there any overhead issues if you make a 2D array arr28 rather than making a 1D array arr16 of size 16 Any memory issues or execution differences between the two?

2D array of size 2x8 and 1D array of size 16


How many arrays can you make with the number 16?

The number of arrays you can make with the number 16 depends on how you define "arrays." If you're referring to the factors of 16, they are 1, 2, 4, 8, and 16, which can form rectangular arrays of various dimensions (e.g., 1x16, 2x8, 4x4). In terms of combinations or arrangements of the number 16 in an array (like in permutations), the possibilities would be significantly greater, depending on the context and constraints you apply.


You have only one rectangular array and you are between the numbers 12 and 16 what number are you?

13...13x1.


What is squre array?

A square array is an array in which the number of rows is the same as the number of columns.


How check four number in c who is bigger?

In order to determine which of four number is bigger you need 16 if statements arranged in a nested if statement. That exceeds the complexity of just sorting it in an array. Here is a solution using a simple array sort. int array[] = {7, 2, 27, 4}; int i, swap; do { swap = 0; for (i = 0; i < 4; ++i) { if (array[i]<array[i+1]) { swap=array[i]; array[i]=array[i+1]; array[i+1]=swap; swap=1; } } } while (swap == 1); printf ("%d\n", array[0]);


How can I get the number of elements in an array in C?

Ah, honey, in C, you can get the number of elements in an array by dividing the total size of the array by the size of one element. So, if you have an array of integers, you can do something like int size = sizeof(array) / sizeof(array[0]); and voilà, you've got the number of elements. Just be careful with those pesky pointers and make sure you're not trying to count elements in a pointer instead of an actual array.


What is the minimum number of swaps required to sort an array?

The minimum number of swaps required to sort an array is equal to the number of inversions in the array.


What is The number of elements in an array is called?

the length of the array


This array field holds the number of elements that the array has?

length


What is square array?

It is an array with the same number of rows and columns.