Examveda

What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
  string str ("helloworld.");
  cout << str.substr(3).substr(4) << endl;
  return 0;
}

A. world.

B. rld.

C. elloworld.

D. hello

Answer: Option B


Join The Discussion

Related Questions on Classes and Objects in C plus plus