Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago