lmasCommyySproughL lmasCommyySproughL
  • 21-01-2017
  • Computers and Technology
contestada

An array's size declarator must be a ________ with a value greater than ________.

Respuesta :

kaevras
kaevras kaevras
  • 21-01-2017
(note that examples are in C++)


Firstly, it must be a constant. Because you can't do something like this:

int x = 5;
int arr[x];

Because x's value could change over time, which is why you get a compile error. If x was a constant, indicated by keyword 'const', then this would compile, as x's value could never change.


Secondly, and obviously, the size of the array must be greater than 0, as you can't have an array with zero or negative number of elements.
Answer Link

Otras preguntas

Why are endospores used to measure the effectiveness of autoclave sterilization?
The distance between the candy shop and Jack's house is 250 meters.what is the distance in kilometers? (km:m=1,000:1)
Graph the line y+3=2(x-1) first identify the slope of the line
The sun produces large amounts of energy. By what process does the sun produce energy?
PLEASE ANSWER WILL MARK BRAINLIEST AND WORTH 20 PTS A scientist measured the distance between fixed points on two different plates over the course of a decade a
which angle is included angle forJL and KL
What are men in congress who wanted to punish the south called?
Who were the "nonassociators" during the american revolution?
A specific amount of energy is emitted when excited electrons in an atom in a sample of an element return to the ground state.This emitted energy can be used to
What happens to the speed of sound as pressure, temperature, and salinity increase?