Question: Please answer all C++ related question 1-8 for positive rate. 1. A data structure is a collection of related data items. The data structures and

Please answer all C++ related question 1-8 for positive rate.

1. A data structure is a collection of related data items. The data structures and (actually class templatessee Chapter #18 for more detail) are part of the C++ Standard Template Library (STL) and therefore are not built-into the C++ programming language. How are and the same? Answer They both allow the programmer to model 1-dimensional homogeneous tables of information. How are they different?

2. (Continuing 1) The built-in C-style pointer-based array type (lets agree to call it arrayC) and the STL are each a contiguous group of memory locations that all have the same data type. What does contiguous mean? What is a data type? How are the components (elements) of an arrayC and an accessed? Note Lets agree to call themarrayC and or simply array when we do not want to distinguish between them.

3. When an array is defined to hold SIZE elements, what is the arrays index range? Why does the index range for an array always begin at 0? Remember array means either arrayC or .

4. What is the precedence of the array element selector operator []? Its associativity? Arity? Syntax? Semantics?

5. T or F? arrayC is a generic data structure. Hint Is a generic data structure? Answer Yes.

6a. Define an arrayC named A that contains 7 unsigned short int elements.

6b. Define an named A that contains 7 unsigned short int elements.

7. (Continuing 6a) Modify your definition of A to include an initializer list that sets each element of A to an integer value that is 1 more than the elements index; that is, initialize A[i] to (i+1), "i [ 0,6 ].

8. Why does it make sense to use the data type size_t (ugly name, right?) to define variables that are specified in subscript expressions? Hint size_t is platform dependent and defined as the unsigned integral type used to specify the size-of an object.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!