What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main(int argc, char const *argv[])
{
string s("a");
cout<<s;
return 0;
}
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main(int argc, char const *argv[])
{
string s("a");
cout<<s;
return 0;
}A. a
B. empty string
C. Error
D. Segmentation fault
Answer: Option A

Join The Discussion