what does this recursive c++ output int m1(int* dat, int len) { int temp = -1; m2(dat,…
Jump to turn (15)
- 1what does this recursive c++ output int m1(int dat, int len) { int temp = -1; m2
- 2The base class constructor will always be called (before / after) the derived co
- 3give me some other relevatant information i should know regardging this topic
- 4An abstract class may only contain pure virtual functions? t or f
- 5A (deep / shallow) copy constructor does a member by member (element by element)
- 6what about deep
- 7what does member by member copy mean
- 8The catch statements in a try..catch block should be ordered with the base excep
- 9ab cde fh hij; if i getline(ifile, s1, ';') will it get only ab or stop entire t
- 10what does ifile.get() do
- 11If Successful: It returns the next character from the stream as an int value. wh
- 12so an int value of 2 is 2?
- 1328 14 explains how if i perform the operation below on the file above it c will
- 14there is a space before 2, so it is " 28 14"
- 15explains how get() works in c++
- User
what does this recursive c++ output int m1(int* dat, int len) { int temp = -1; m2(dat, len, temp); return temp; } void m2(int* dat, int len, int& num) { if(len <= 1){ num = *dat; } else if(num == -1){ num = 0; m2(dat+1, len-1, num); num += *dat; } else { m2(dat+1, len-1, num); } } int main() { int data[4] = {3, 6, 2, 9}; cout << m1(data, 4) << endl;; // what will be output? }
- Assistant