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

please explain how you got your answer.
Imagine you were alive in the Middle Ages and knew someone with a mental illness. How would you help them get their mental health needs met?
I NEED URGENT HELP NOW PLEASE!!!!! Which graph represents an increasing function? Four graphs of y against x are shown. The title for the first graph is Grap
why do you think that government must assume the overall responsibility for public facilities even when it gets private companies to do party of the job?
A square painting painting is surrounded by a frame. the outside edges of the frame are 3 inches in length, and the frame is 3 inches thick. What is the total
How many feet are there in 3 miles
Solve the proportion. start fraction 42/15 = p/10
Compare and contrast the Iroquois constitution to the u.s. constitution
can anyone write a haiku
Convert the acceleration of a free falling body 9.8 m/s^2 to ft/s^2