✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Чи працюватиме код поданий далі? Якщо так, то який результат його виконання?
#include <iostream>
using namespace std;
struct P
{
char * str;
int a;
};
P* create() {
P* ptr = new P;
ptr->str = new char[6];
strcpy_s(ptr->str,6, "Hello");
ptr->a = 10;
return ptr;
}
void main() {
P* o = create();
cout << o->str << "\t" << o->a << "\n";
}