1. To pass an array as an argument to a function, pass the ____ of the array. a)
ID: 3570761 • Letter: 1
Question
1. To pass an array as an argument to a function, pass the ____ of the array.
a) contents
b) size, expressed as an integer
c) name
d) value of the first element
e) none
2. An array with no elements is ____.
a) legal in C++
b) illegal in C++
c) automatically furnished one element, with a value of zero
d) automatically furnished one value-the null terminator
e) none of these
3. An array of string objects that will hold 5 names would be declared using which statement?
a) string names [5];
b) string names (5);
c) string names5;
d) String[5] names;
e) none of these will work
4. What is the last legal subscript that can be used with the folowing array?
int values [5];
a) 0
b) 5
c) 6
d) 4
5. How many elements does the following array have?
int bugs [1000];
a) 1000
b) 999
c) 1001
d) cannot tell from the code
Explanation / Answer
1).To pass an array as an argument to a function, pass the ____ of the array
c) name( only name required to pass array in a function , but where as to declare we need a name and size of the array)
2) .
An array with no elements is ____.
a) legal in C++ ( It doesn't matter actually)
3)
An array of string objects that will hold 5 names would be declared using which statement?
a) string names [5];
syntax for string objects is : string name [size]
4).
What is the last legal subscript that can be used with the folowing array?
int values [5];
legal subscript is = 4
5).
How many elements does the following array have?
int bugs [1000];
it has 1000 elements
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.