I see this post: c++ - Why doesn't std::string_view have assign() and clear() methods? - Stack Overflow, so string_view does not contain clear functio ...
I see this post: c++ - Why doesn't std::string_view have assign() and clear() methods? - Stack Overflow, so string_view does not contain clear functio ...
I need to create a char[] dynamically. I would like to use std::string instead of working on char[] directly since I don't need to take care of the me ...
How do I accept an unknown number of lines in c++? Each line has two strings in it separated by a space. I tried the solutions mentioned in This cplus ...
I am trying to solve a problem just like this one: std::string formatting like sprintf: std::string formatting like sprintf However the problem I a ...
Is calling this function creating a memory leak? I've read about "value semantics" but I can't envision it. ...
Intro If I catch an exception, I want to convert the error message, which is returned as a C-style string by the what() method, into a std::u8string ...
I have a C++ program which is compiled using gcc4.4.5 and runs on redhat 6.1. The program is compiled with -m64 and the CPU is Intel-64. It always abo ...
I'm piecing together a C++20 puzzle. Here's what I want to do: Function append_params will concatenate the url together with additional query paramete ...
My aim is to create my own analogue of std::basic_string but with some additional conditions. I want my AnyString<CharType, Traits> to be conver ...
I am trying to implement my own basic_string, but came across a problem with printing my strings. I am not going to use std::char_traits and other tra ...
The problem is I don't understand why those should be separate. Why not use one class, like CharType, that would contain both the logic of char traits ...
I know this string business is a bad idea, but I have to know it anyways: So I want to read an xml using property tree while storing it inside my own ...
I am trying to create a very simple function: In order to avoid unnecessary allocations I thought I could use a string_view: However the last fu ...
Even though I am afraid to appear really stupid, I would like to ask why this program: #include <iostream> #include <fstream> int main(i ...
case1: #include <string> inline constexpr std::string test(std::string s) noexcept { return s + "xxx"; } int main() { auto s = test(" ...
I have to determine if the input is a digit or a string. For this I get error: no matching function for call to 'isdigit(std::__cxx11::string&) ...
I think i cant understand something in the logic of my cycles, cant u match my mistake? We need to reverse the number. My code: ...
I would like to know how to properly handle a string input in a function, if I know I will have to make a copy inside of it to place it inside a conta ...
Let's suppose I've this code snippet in C++ I need to copy the string data (except the first and the last characters) in str. My solution that seem ...
I am getting a dangling pointer warning from VS2022 for this code snippet: Warning getProgramUUID() returns a std::string and is defined as b ...