CPP_INTERVIEW_LIB Telegram 343
🍔 Как преобразовать std::string в const char* или char*?

Если мы хотим передать std::string в функцию, которой требуется const char*, можно использовать .c_str()

Для получения неконстантной строки char*, вызываем .data(). Появилось в C++17, до этого можно было использовать &str[0]

‼️ Указатель становится недействительным, если строка уничтожается
👍131🥱1



tgoop.com/cpp_interview_lib/343
Create:
Last Update:

🍔 Как преобразовать std::string в const char* или char*?

Если мы хотим передать std::string в функцию, которой требуется const char*, можно использовать .c_str()

Для получения неконстантной строки char*, вызываем .data(). Появилось в C++17, до этого можно было использовать &str[0]

‼️ Указатель становится недействительным, если строка уничтожается

BY Библиотека собеса по C++ | вопросы с собеседований




Share with your friend now:
tgoop.com/cpp_interview_lib/343

View MORE
Open in Telegram


Telegram News

Date: |

Some Telegram Channels content management tips Telegram has announced a number of measures aiming to tackle the spread of disinformation through its platform in Brazil. These features are part of an agreement between the platform and the country's authorities ahead of the elections in October. Matt Hussey, editorial director at NEAR Protocol also responded to this news with “#meIRL”. Just as you search “Bear Market Screaming” in Telegram, you will see a Pepe frog yelling as the group’s featured image. Click “Save” ; On Tuesday, some local media outlets included Sing Tao Daily cited sources as saying the Hong Kong government was considering restricting access to Telegram. Privacy Commissioner for Personal Data Ada Chung told to the Legislative Council on Monday that government officials, police and lawmakers remain the targets of “doxxing” despite a privacy law amendment last year that criminalised the malicious disclosure of personal information.
from us


Telegram Библиотека собеса по C++ | вопросы с собеседований
FROM American