answersLogoWhite

0


Best Answer

As many as you like. It ultimately depends on the type of the array. An array of int can obviously only store one integer value per element, however an array of integer arrays would allow us to store two or more integers per element. This is precisely how multi-dimensional arrays are implemented:

int x[4][5];

Here we've declared a 4-element array where each element is an array of 5 integer elements. Thus each element of the "outer" array can hold 5 values in the "inner" arrays. In reality this is just a 20-element array with one integer per element, but because we declared it multi-dimensionally we can refer to each of the 4 "inner" arrays individually as an array in its own right.

Arrays of arrays are useful when dealing with homogeneous types, but if we need to store heterogeneous types we can use an array of structures instead:

typedef struct person_t {

char name[50];

size_t age;

} person;

person x[100];

Here we've declared an array of 100 person objects. But each person object has two member values associated with it; a name and an age:

x[0].name = "Joe Bloggs";

x[0].age = 42;

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many values can each element in a seven-element array hold?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is an element in the Array?

An array is a container object that holds a fixed number of values of a single type. ... Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the preceding illustration, numbering begins with 0. The 9th element, for example, would therefore be accessed at index 8.


How do you find the quartile in an even array of values?

Divide the array in half and get the median of each half


How do you draw pascals triangle in gwbasic?

I suggest using an array with as many elements as the longest row you need. To keep it simple, keep two copies of the array, and calculate each element of the "new" array as the sum of the corresponding element, plus the previous element, of the "old" array. Then copy the information back for the next step.


What is meant by irregular dimensional array?

An irregular dimensional array is a special type of multi-dimensional array.First we must understand that a multi-dimensional array is just an array of arrays. Each element in the array is, itself, an array of elements.A regular multi-dimensional array will be an array of size n, with each element containing a separate array of size m. That is, each sub-array has the same size.An irregular multi-dimensional array will be a multi-dimensional array in which each sub-array does not contain the same number of elements.Regular array:array[0] = new array{0, 1, 2}array[1] = new array{3, 4, 5}array[2] = new array{6, 7, 8}array[3] = new array{9, 10, 11}This regular array is an array of size 4 in which each sub-array is of size 3.Irregular array:array[0] = new array{0, 1, 2}array[1] = new array{3, 4}array[2] = new array{5, 6, 7}array[3] = new array{8, 9, 10, 11}This irregular array is an array of size 4 in which the size of each sub-array is not the same.


How do you declare an array on Pascal?

type array-identifier = array[index-type] of element-type; array-identifier : the name of your array index-type : any scaler except real element-type : the type of element The index type defines the range of indices and thus the number of elements to allocate. For example, [0..41] will allocate 42 elements indexed from 0 to 41, thus creating a zero-based array. If you require a one-based array, use [1..42] instead. Regardless of the range of indices, the first element is always at the lowest address of the array (the compiler will convert your index range into a zero-based range automatically). The element-type determines the length of each element in the array. Multiplying the element length by the number of elements gives the total amount of memory allocated to the array.

Related questions

What is an element in the Array?

An array is a container object that holds a fixed number of values of a single type. ... Each item in an array is called an element, and each element is accessed by its numerical index. As shown in the preceding illustration, numbering begins with 0. The 9th element, for example, would therefore be accessed at index 8.


How to make a program using array?

An array is a variable name that can store several values, not just one. Each element is accessed through the variable name, combined with a subscript - a number used to distinguish the elements in the array.Basically you usually would do each of the following:Declare the variableInitialize the array, that is, assign values to each elementRetrieve the values at some later pointHere is an example with Java:// The following will both declare an array, and assign initial values to itint myArray = {5, 10, 15}// The following will show each of the values:for (int i = 0; i < myArray.length(); i++)System.out.println("Element # " + i + " has the value " + myArray[i];Note that in Java, the element numbering starts at zero.


Sum of n numbers using array?

Set sum = 0, then add each of the elements of the array, one by one. Use a for loop to process each element of the array.Set sum = 0, then add each of the elements of the array, one by one. Use a for loop to process each element of the array.Set sum = 0, then add each of the elements of the array, one by one. Use a for loop to process each element of the array.Set sum = 0, then add each of the elements of the array, one by one. Use a for loop to process each element of the array.


How do you find the quartile in an even array of values?

Divide the array in half and get the median of each half


Can you compute one array in c say and then assign b to a?

Yes, you can. You have to do that in the following way. Each element of A should be assighed each element of B. You have to do it manually means you have to write a loop which will do it for you. In C array A = array B is not correct.


What is the memory address of some element if the base address is x and each element of the array takes e memory locations?

The memory address of some element if the base address is x, each element of the array takes e memory locations, and the index based zero of the element is i, is x + ie.


How do you draw pascals triangle in gwbasic?

I suggest using an array with as many elements as the longest row you need. To keep it simple, keep two copies of the array, and calculate each element of the "new" array as the sum of the corresponding element, plus the previous element, of the "old" array. Then copy the information back for the next step.


What does array map do in php?

The array_map function in PHP loops over each elements of the passed array(s), and runs the given function. It then returns a new array that contains the values returned by each call to the given function.


An array of size N is given in which every number is between 1 and N determine if there are any duplicates in it You are allowed to destroy the array if you like?

Answer 1Sort it first, then check each element in the array to see if there is an identical one next to it.Answer 2Iterate through the array, and at each element check to see if any of the other elements in the array are equal to the current one.Answer 3Since we know that if each element in the array must be in the range [1,N] then we also know that each number should exist exactly once. So we can iterate through the numbers (1,2,3...N) and check to see if each number exists. If any does not exist, we know there must be a duplicate.


What is the use of Arrays?

Arrays are a primitive container for data of the same type. The elements of an array are stored in a block of contiguous memory, one after the other. As such, an array offers the most compact method of storing a collection of values. Unlike ordinary variables, which can be named, the elements of an array are anonymous; we can only refer to them by their memory address. However, given that each element is the same type and therefore the same length (in bytes), it is trivial to calculate the address of any element within the array knowing only the start address of the array (which can be named) and the zero-based index of the element we wish to access, such that the first element resides at index 0. Since calculating individual addresses is a constant-time operation, this makes it possible to perform constant-time random-access to any element in the array. However, the array suffix operator means we do not need to manually calculate individual addresses, we need only know the zero-based index of the element we wish to access.


What is meant by irregular dimensional array?

An irregular dimensional array is a special type of multi-dimensional array.First we must understand that a multi-dimensional array is just an array of arrays. Each element in the array is, itself, an array of elements.A regular multi-dimensional array will be an array of size n, with each element containing a separate array of size m. That is, each sub-array has the same size.An irregular multi-dimensional array will be a multi-dimensional array in which each sub-array does not contain the same number of elements.Regular array:array[0] = new array{0, 1, 2}array[1] = new array{3, 4, 5}array[2] = new array{6, 7, 8}array[3] = new array{9, 10, 11}This regular array is an array of size 4 in which each sub-array is of size 3.Irregular array:array[0] = new array{0, 1, 2}array[1] = new array{3, 4}array[2] = new array{5, 6, 7}array[3] = new array{8, 9, 10, 11}This irregular array is an array of size 4 in which the size of each sub-array is not the same.


What is an array of 5 x 46?

An array is a contiguous memory allocation divided into one or more elements of equal size. A 5 x 46 array is an array of 5 elements where each element is another array of 46 elements. In other words it is an array of arrays. We can the array a two-dimensional array because it has 5 elements in one dimension (the rows) and 46 in the other dimension (the columns). If an individual column element is 4 bytes long, then each row element consumes 46 x 4 = 184 bytes of memory while the entire array consumes 5 x 184 = 920 bytes in total. We can also think of the entire array as being a one-dimensional array of 5 x 46 = 320 elements of 4 bytes each.