Ask Question

When you create an array variable, memory space is automatically reserved.

True

False

+1
Answers (1)
  1. 23 November, 22:54
    0
    The answer is true.

    Explanation:

    An array is a collection of data of the same type. It is used to handle a number ''n'' of elements in common, either of types defined by the language (int, float, string, etc) as well as those defined by the programmer.

    A one dimensional array is a structured data type that is made up of a finite, ordered collection of data of the same type.

    A vector, also called a one dimensional array, is a data structure that allows you to group elements of the same type and store them in a single block of memory together, one after the other. This group of elements is identified by the same name and the position in which they are found. Ther first position of the array is position zero.

    We could group in an array a series of elements of integer type, floating, etc. For example:

    int a [5]; (vector of 5 integers)

    float b[5]; (vector of 5 floating)

    int a [] = {5,6,7,8,9};

    float b [] = {5.1,5.2,5.3,5.4,5.5};

    Since there are 5 elements in each array, automatically 5 memory spaces will be assigned to each vector, but if I try to create the vector of the form int a [], the compiler will show an error, because I did not indicate the size of the vector and I did not initialize its elements.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “When you create an array variable, memory space is automatically reserved. True False ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers