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

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

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

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



tgoop.com/cppproglib/4673
Create:
Last Update:

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

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

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

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

BY Библиотека C/C++ разработчика | cpp, boost, qt




Share with your friend now:
tgoop.com/cppproglib/4673

View MORE
Open in Telegram


Telegram News

Date: |

How to create a business channel on Telegram? (Tutorial) A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. Other crimes that the SUCK Channel incited under Ng’s watch included using corrosive chemicals to make explosives and causing grievous bodily harm with intent. The court also found Ng responsible for calling on people to assist protesters who clashed violently with police at several universities in November 2019. Just at this time, Bitcoin and the broader crypto market have dropped to new 2022 lows. The Bitcoin price has tanked 10 percent dropping to $20,000. On the other hand, the altcoin space is witnessing even more brutal correction. Bitcoin has dropped nearly 60 percent year-to-date and more than 70 percent since its all-time high in November 2021. Members can post their voice notes of themselves screaming. Interestingly, the group doesn’t allow to post anything else which might lead to an instant ban. As of now, there are more than 330 members in the group.
from us


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM American