About 2,170,000 results
Open links in new tab
  1. String Functions in C++ - GeeksforGeeks

    Apr 24, 2025 · In C++, a stream/sequence of characters is stored in a char array. C++ includes the std::string class that is used to represent strings. It is one of the most fundamental datatypes in C++ and it comes with a huge set of inbuilt functions. In this article, will look at the functions of string computations. What is std::string?

  2. c++ - How is std::string implemented? - Stack Overflow

    Sep 23, 2009 · The c++ solution for strings are quite different from the c-version. The first and most important difference is while the c using the ASCIIZ solution, the std::string and std::wstring are using two iterators (pointers) to store the actual string.

  3. string - C++ Users

    The string class is an instantiation of the basic_string class template that uses char (i.e., bytes) as its character type, with its default char_traits and allocator types (see basic_string for more info on the template).

  4. C++ String Function: strcpy(), strcat(), strlen(), strcmp() Example

    Nov 21, 2024 · Strings belong to the standard string class in C++. We can declare strings using the C-style character string or standard string class. The strcpy() function copies one string into another.

  5. C++ string Library Reference (string functions) - W3Schools

    Returns the length of a string. Learn more about strings in our C++ Strings Tutorial. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.

  6. libc++’s implementation of std::string - Joel Laity

    Jan 31, 2020 · std::string has two modes: long string and short string. It uses a union to reuse the same bytes for both modes. Short string mode is an optimization which makes it possible to store up to 22 characters without heap allocation. Long string mode. The long string mode is a pretty standard string implementation. There are three members:

  7. How to create a custom String class in C++ with basic functionalities

    Feb 1, 2022 · In this article, we will create our custom string class which will have the same functionality as the existing string class. Constructor with no arguments: This allocates the storage for the string object in the heap and assign the value as a NULL character.

  8. Write your own C++ STL string class | by Karan Kakwani - Medium

    Apr 6, 2020 · Below is the complete implementation of the my_string class. I have overridden the ostream operator to support outputting our string to console using std::cout.

  9. Chapter 7. Strings - GCC, the GNU Compiler Collection

    Here are Standard, simple, and portable ways to perform common transformations on a string instance, such as "convert to all upper case." The word transformations is especially apt, because the standard template function transform<> is used. This code will go through some iterations. Here's a simple version:

  10. C++ String class implementation - Stack Overflow

    Apr 5, 2021 · My project asks to implement a string class in C++, however, I'm confused about one of the public function. class String { private: char* buffer; int size; public: // Initializes a string to be empty (i.e., its length will // be zero and toChars () will return "").

Refresh