logo

Crowdly

Browser

Add to Chrome

Чи працюватиме код поданий далі? Якщо так, то який результат його виконання? #i...

✅ 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";

}

More questions like this

Want instant access to all verified answers on vns.lpnu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome