-
What is the output of this program?
#include <iostream>
#include <memory>
#include <string>
using namespace std;
int main ()
{
pair <string*, ptrdiff_t> Res = get_temporary_buffer<string>(5);
if (Res.second > 0)
{
uninitialized_fill ( Res.first, Res.first + Res.second,
"Bye " );
for (int k = 0; k < Res.second; k++)
cout << Res.first[k] ;
return_temporary_buffer(Res.first);
}
return 0;
}
-
- Bye
- Bye Bye Bye
- Bye Bye Bye Bye Bye
- Bye Bye
- Bye Bye Bye Bye
Correct Option: C
In this program, We storing the string in the string buffer and then we are printing it.