• Navigate
    • 22.4 — std::string character access and conversion to C-style arrays
    • Table of contents
    • 22.2 — std::string construction and destruction
  • Site Index
  • Latest Changes
  • About
    • Leave feedback
    • Report an issue
    • Contact / Support
    • Site FAQ
    • Privacy Policy
    • Donate
  •  
  • Search
Learn C++
Learn C++
Skill up with our free tutorials
Skip to content
  • Navigate
    • 22.4 — std::string character access and conversion to C-style arrays
    • Table of contents
    • 22.2 — std::string construction and destruction
  • Site Index
  • Latest Changes
  • About
    • Leave feedback
    • Report an issue
    • Contact / Support
    • Site FAQ
    • Privacy Policy
    • Donate
  •  
  • Search
Month: September 2009

Month: September 2009

22.3 — std::string length and capacity

50

Once you’ve created strings, it’s often useful to know how long they are. This is where length and capacity operations come into play. We’ll also discuss various ways to convert std::string back into C-style strings, so you can use them with functions that expect strings of type char*. Length of …

Alex September 27, 2009, 10:09 am PDT August 15, 2022
Continue reading"22.3 — std::string length and capacity"

22.2 — std::string construction and destruction

70

In this lesson, we’ll take a look at how to construct objects of std::string, as well as how to create strings from numbers and vice-versa. String construction The string classes have a number of constructors that can be used to create strings. We’ll take a look at each of them …

Alex September 20, 2009, 10:10 am PDT June 15, 2023
Continue reading"22.2 — std::string construction and destruction"

22.1 — std::string and std::wstring

107

The standard library contains many useful classes — but perhaps the most useful is std::string. std::string (and std::wstring) is a string class that provides many operations to assign, compare, and modify strings. In this chapter, we’ll look into these string classes in depth. Note: C-style strings will be referred to …

Alex September 12, 2009, 2:43 pm PDT August 12, 2023
Continue reading"22.1 — std::string and std::wstring"

2.13 — How to design your first programs

495

Now that you’ve learned some basics about programs, let’s look more closely at how to design a program. When you sit down to write a program, generally you have some kind of idea, which you’d like to write a program for. New programmers often have trouble figuring out how to …

Alex September 5, 2009, 3:00 pm PDT January 6, 2025
Continue reading"2.13 — How to design your first programs"

©2024 Learn C++ Privacy Policy