123k views
3 votes
The one place where C++ allows aggregate operations on arrays is the input and output of C-strings.

A. True.
B. False.

User Abnerl
by
9.0k points

1 Answer

5 votes

Final answer:

The statement is False. C++ allows aggregate operations on arrays in various scenarios, not just input and output of C-strings.

Step-by-step explanation:

The statement is False.

C++ allows aggregate operations on arrays in various scenarios, not just input and output of C-strings. Aggregate operations on arrays are supported in C++ through features such as range-based for loop, standard algorithms, and libraries like vector.

For example, consider the following code snippet:

#include <iostream>
#include <vector>

int main() {
std::vector<int> arr {1, 2, 3, 4, 5};

// Print array elements
for (int num : arr) {
std::cout << num << " ";
}

return 0;
}

This code uses the vector library to create an array and then uses a range-based for loop to iterate over and print each element of the array.

User Bkildow
by
8.0k points