Telegram Group & Telegram Channel
Что выведет код сверху?

Ответ: “Constructor called” 5 раз и затем “Destructor called” 5 раз.

В приведенной выше программе мы сначала инициировали переменные с пятью указателями, используя ключевое слово new, следовательно, после этого будет вызван конструктор fives time, поскольку мы используем delete[] (используется для удаления нескольких объектов) для удаления переменных, следовательно, все созданные пять объектов будут уничтожены и, следовательно, будет вызван деструктор five times.

➡️ @cpp_geek



tg-me.com/cpp_geek/252
Create:
Last Update:

Что выведет код сверху?

Ответ: “Constructor called” 5 раз и затем “Destructor called” 5 раз.

В приведенной выше программе мы сначала инициировали переменные с пятью указателями, используя ключевое слово new, следовательно, после этого будет вызван конструктор fives time, поскольку мы используем delete[] (используется для удаления нескольких объектов) для удаления переменных, следовательно, все созданные пять объектов будут уничтожены и, следовательно, будет вызван деструктор five times.

➡️ @cpp_geek

BY C++ geek




Share with your friend now:
tg-me.com/cpp_geek/252

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

telegram from es


Telegram C++ geek
FROM USA