What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
char str[] = "Hello World";
cout<<str[0];
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[])
{
char str[] = "Hello World";
cout<<str[0];
return 0;
}A. H
B. e
C. Error
D. o
Answer: Option A

Join The Discussion