Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. The definition of an array of pointers to functions of size (ol that take two integers as input parameters, and of return type of

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. The definition of an array of pointers to functions of size (ol that take two integers as input parameters, and of return type of bool. a. bool (*pte[n])int a, int b) b. bool *ptr(int a, int b) c. 2. 3. d. T (*ptr)(T&) e. Te function(T&) T* ptr ToObject : a. names a pointer that holds the address of a region of type T b. names a pointer that holds the address of a region of type T () (T6) C. names a function that receives a reference to an object of type Te and returns the address of a region that holds an object of type T d. All of the above e. None of the above T("ptr ToFunction)(T&): a. names a pointer that holds the address of a region of type T b. names a pointer that holds the address of a region of type T (*) (76) C names a function that receives a reference to an object of type TG and returns the address of a region that holds an object of type T d. All of the above e. None of the above T* function(T&): a. names a pointer that holds the address of a region of type T b. names a pointer that holds the address of a region of type T (*)(T6) o names a function that receives a reference to an object of type Te and returns the address of a region that holds an object of type T d. All of the above e. None of the above 4. Code 1.0 // decltype with templates // deeltype.cpp 1. #include decltype (t + u) ( return t + u;) 4. int main() { int i 3 , 6: double x- 4.5; atd::cout // ascending order comparison template bool ascending (Ta, Tb) (return a > b: ) // descending order comparison template bool descending (T a, Tb) { return a void sort(T* a, int n, bool (*comp) (T, T)) { for (int i -n- 1; i > 0; i--) { for (int j = 0; j void display (T* a, int n) { for (int i 0; i // order options enum class Order (ascending, descending); // order comparison template class Compare Order order; public: Compare (Order o) ! order (o) () bool operator () (T6 a, T. b) const { return order - Order:: ascending ? a > b a b ; comp) // bubble sort template void sort (T. a, int n, const Compare for (int i-n- 1; i > 0; i--) { for (int j = 0; j void display (T* a, int n) for (int i = 0; i (Order: ascending) ) display (a, n): sort(a, n, Comparecint> (Order:descending)): display (a, n): Answer Questions 11 using Code 4.0 11. Compare is a. Function object b. Function pointer C. Lambda function d. All of the above e. None of the above Code5.0 1. Jinclude 2. template 5. int sub (int i, Punc func) { return func(i); } 6. int main() { Int k - 4; stdtscout > <><>

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

Step: 3

blur-text-image

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

Imagine you remain in the job listed under point

Answered: 1 week ago