lang:cpp:string
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
lang:cpp:string [2023/01/30 09:42] – Ajout de consteval avec std::string_view root | lang:cpp:string [2023/05/29 11:58] (Version actuelle) – [consteval avec std::string_view] : fix lien root | ||
---|---|---|---|
Ligne 15: | Ligne 15: | ||
[[https:// | [[https:// | ||
+ | |||
+ | * Conversion entre string et wstring | ||
+ | |||
+ | Sous windows : | ||
+ | |||
+ | <code cpp> | ||
+ | std:: | ||
+ | { | ||
+ | int slength = (int)s.length() + 1; | ||
+ | int len = MultiByteToWideChar(CP_ACP, | ||
+ | std:: | ||
+ | MultiByteToWideChar(CP_ACP, | ||
+ | return r; | ||
+ | } | ||
+ | |||
+ | std::string ws2s(const std:: | ||
+ | { | ||
+ | int slength = (int)s.length() + 1; | ||
+ | int len = WideCharToMultiByte(CP_ACP, | ||
+ | std::string r(len, ' | ||
+ | WideCharToMultiByte(CP_ACP, | ||
+ | return r; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
====stringstream=== | ====stringstream=== | ||
Ligne 60: | Ligne 86: | ||
</ | </ | ||
- | [[https:// | + | [[https:// |
====Split==== | ====Split==== | ||
===string=== | ===string=== |
lang/cpp/string.1675068125.txt.gz · Dernière modification : 2023/01/30 09:42 de root