Write a C++ function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. To test your function, write a main that prompts a ...
SIKSHAPATH Latest Questions
Write a templated class named “EveryOther” that behaves much like std::vector (in the file named “everyother.h”). It has a member function called “push_back”, but only every other call to the member function actually does anything (actually pushed the element to ...
What’s printed by the following code fragment? set<int> s; s.insert(100); s.insert(25); for(auto e : s) cout << e
My program contains the line: delete x; It does not cause a compile time error. Which of the following is a possibledeclaration for x? a. int x; b. double x; c. double *x; d. int x[10];
To create an array of integers which can be accessed as A[0],…,A[4] residing on the heap the code to be executed is: a. int A[5]; b. int *A = new int[5]; c. int A = new int[5]; d. int new A[5];
What is the value of variable count at the end of execution?