What will be the result of the following function call?
#include <iostream>
#include <string>

using namespace std;

const string &foo(const string &s)
{
  return s;
}

int main()
{
  const string &res = foo("abc");  // 1

  cout << res << endl;

  return 0;
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes