answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What must each variable in an array have that are the same as others?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How array differ from ordinary variable?

ordanry variable store one value at a time. arrays are used for storing more than one value at a time in a single variable name ordanry variable doesnt have subscript. array must have subscript syntax for ord. variable Datatype v1,v2...... syntax for array variable Datatype v1[n1],v2[n2].....


What restriction must be satisfied by all of the data items represented by an array?

An array is a group of related items that share a common name.All these elements are stored consecutively. An array must be declared before its use in the program. Array size must be specified All Array elements must be assigned to any value for assignment the value. Partial initialization of elements of an array is not allowed. Size must be integer constant enclosed within square brackets The name of the array indicates starting address of an array. Each individual element of array is accessed by a subscript.


What is the difference between subscript and subscripted variable in c plus plus?

Subscripts are used to identify the elements in an array, where the first element has subscript 0. Thus an array of n elements has subscripts in the range 0 to n-1. Each element may itself be an array, thus allowing multi-dimensional arrays. The subscript may be a constant or a variable. However, when declaring a static array, the subscript must be a constant. Constants include literal constants as well as named constants. A subscripted variable is simply an array or a datatype that can be divided into an array. For instance, a 32-bit int can be treated just as if it were an array of two 16-bit shorts or four 1-byte chars. Thus in the 32-bit int array, int i[10], i is a subscripted variable where i[0] is the first integer and i[9] is the last. If we then say char*c=&i, c would allow us to treat i as if it were a subscripted variable with 40 char elements (c[0] to c[39]).


How can you make a array with the number 16?

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;


What is the difference between array element and variable?

• Array is the set of an multiple values where as variable can store single value at a time.• The difference between the definition of array and ordinary variable is the, array is always declared, initialized, and accessed using subscript whereas ordinary variable do not have any subscript.• The syntax for ordinary variable definition is data_type v1, v2, ….;• And the syntax for array variable is data_type v1[N1],v2[N2],…; where v1,v2 are name of variable and N1, N2 are the integer constants indicating the maximum size of array.

Related questions

How array differ from ordinary variable?

ordanry variable store one value at a time. arrays are used for storing more than one value at a time in a single variable name ordanry variable doesnt have subscript. array must have subscript syntax for ord. variable Datatype v1,v2...... syntax for array variable Datatype v1[n1],v2[n2].....


What is the difference between an array element and a variable?

Array elements are all members of the same variable, indexed in a logical manner. variables are distinct objects which must be referred to distinctly. The main functional difference is that a program can iterate over an array without the programmer knowing the original size of the array or explicitly which member to access.


True or false In a nonlinear equation each variable must only have one solution?

In a nonlinear equation, each variable must only have one solution.


What is array of string?

An array of strings is usually implemented as an array of character pointers. Each pointer refers to a a null-terminated character array, and can be treated just as if it were a two-dimensional array where the length of each "row" is not fixed length (the null terminator marks the end of each row). The array of character pointers must be allocated in contiguous memory (as must all one-dimensional arrays), however the character arrays they point to need not be allocated contiguously with each other (only the individual one-dimensional character arrays must be contiguous).


What restriction must be satisfied by all of the data items represented by an array?

An array is a group of related items that share a common name.All these elements are stored consecutively. An array must be declared before its use in the program. Array size must be specified All Array elements must be assigned to any value for assignment the value. Partial initialization of elements of an array is not allowed. Size must be integer constant enclosed within square brackets The name of the array indicates starting address of an array. Each individual element of array is accessed by a subscript.


What is the difference between subscript and subscripted variable in c plus plus?

Subscripts are used to identify the elements in an array, where the first element has subscript 0. Thus an array of n elements has subscripts in the range 0 to n-1. Each element may itself be an array, thus allowing multi-dimensional arrays. The subscript may be a constant or a variable. However, when declaring a static array, the subscript must be a constant. Constants include literal constants as well as named constants. A subscripted variable is simply an array or a datatype that can be divided into an array. For instance, a 32-bit int can be treated just as if it were an array of two 16-bit shorts or four 1-byte chars. Thus in the 32-bit int array, int i[10], i is a subscripted variable where i[0] is the first integer and i[9] is the last. If we then say char*c=&i, c would allow us to treat i as if it were a subscripted variable with 40 char elements (c[0] to c[39]).


What String of what?

An array of strings is usually implemented as an array of character pointers. Each pointer refers to a a null-terminated character array, and can be treated just as if it were a two-dimensional array where the length of each "row" is not fixed length (the null terminator marks the end of each row). The array of character pointers must be allocated in contiguous memory (as must all one-dimensional arrays), however the character arrays they point to need not be allocated contiguously with each other (only the individual one-dimensional character arrays must be contiguous).


Which Oracle type must you use to make values inserted into an associative array persist over the life of a user's session?

Package variable


How can you make a array with the number 16?

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;


What is the difference between array element and variable?

• Array is the set of an multiple values where as variable can store single value at a time.• The difference between the definition of array and ordinary variable is the, array is always declared, initialized, and accessed using subscript whereas ordinary variable do not have any subscript.• The syntax for ordinary variable definition is data_type v1, v2, ….;• And the syntax for array variable is data_type v1[N1],v2[N2],…; where v1,v2 are name of variable and N1, N2 are the integer constants indicating the maximum size of array.


How is an array name interpretedwhen it is passed to a function?

An array is still an array, regardless of how you pass it into functions. It is still an array-type variable at the beginning of a function. However, the function itself may manipulate the array by "imploding" it into a string with a delimiter, using array values with only specific keys, and such.


How arrays must be handled in c plus plus?

If the array is static it can declared in the structure itself: struct myArrayTag { int num[12]; // array of 12 integers (e.g., 48 bytes). } myArray; If it is dynamic then you must use a pointer and allocate the array outside the structure. You should also maintain a variable in the structure to keep track of how many elements the array currently has: struct myBufferTag { int * array; // Pointer to array of integers. int size; // Size of array (number of elements); } myBuffer;