answersLogoWhite

0

Where can one find more information about STD Strings?

Updated: 8/20/2019
User Avatar

Wiki User

10y ago

Best Answer

One can find more information about STD String on websites like C Plus Plus, Wikipedia, Microsoft, Stack Overflow, learn CPP, WX Widgets or Your Linux.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Where can one find more information about STD Strings?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a program that allows the user to enter any number of strings that will then be encoded decoded and then displayed to the console?

#include<iostream> #include<string> #include<vector> std::string encode (const std::string&); std::string decode (const std::string&); int main () { std::vector<string> strings; std::cout<<"Enter as many strings as you like (end with an empty string)\n"; while (true) { std::string input; std::cout<<"Enter a string: "; std::getline (std::cin, input); if (input.empty()) break; strings.push_back (encode (input)); } std::cout<<"You entered the following strings:\n"; for (auto s : strings) std::cout<<decode (s)<<std::endl; } Note that it is not possible to show the implementation details of the encode and decode functions since it is not clear from the question what the purpose of these functions is.


Rearrange the string in alphabetical order in two dimensional character array?

Use a std::vector<std::string>> to store the strings, then call the std::vector::sort() method.


What are the advantages of using string in c plus plus?

I assume you mean std::string rather than strings in general. Programs that need to convey any information to the user will usually require many strings, and when retreiving input from the user, a string (in conjunction with a string stream) are the best way of checking that data before processing it. The std::string (and its wide-character counterpart, std::wstring) needn't be used for all strings, of course, but they are much easier to work with when strings need additional processing, such as when concatenating strings, or searching within strings. And if you need more functionality than is provided by std::string alone, you can always derive a new string object from std::string and embelish it as required. Of course, if you require less functionality than is provided by std::string then you have the option of creating your own lightweight string class from scratch. However, for most applications, std::string is lightweight enough, and if you use std::string at all, then there's little point in writing your own string class. Aside from re-inventing the wheel (one of the reasons the STL exists), it's only going to increase your code size. However, for new programmers, it can be an interesting excercise creating your own string class, if only to show how std::string works and why re-inventing wheels is rarely a good thing.


How do write a function that receives two pointers to character strings where the function concatenates the two strings and prints the new concatenated string?

#include <iostream> #include <string> std::string* concat_print_strings(std::string* pStr1, std::string* pStr2 ) { std::string * strResult = new std::string( *pStr1 ); strResult->append( *pStr2 ); std::cout << strResult->c_str() << std::endl; return( strResult ); } int main() { std::string str1 = "This is a string."; std::string str2 = " And this is another string."; std::string* pStr = concat_print_strings( &str1, &str2 ); delete( pStr ); pStr = NULL; return( 0 ); }


How can you get a specific string from large string using c plus plus strings?

std::string::substr();


How do you write a c plus plus program to sort a vector of strings using MSD radix sort?

The standard library sort algorithm automatically uses MSD radix to sort strings: std::vector<std::string> vs = {"a", "b", "c" "d", "ab"}; std::sort(vs.begin(), vs.end()); After sorting, the order will be: {"a", "ab", "b", "c", "d"}


Govermint Information STD 1to 12 school commissinor?

Govermint Information std 1to 12 school commissinor?


Where can you get information about chlamydia?

You can learn more about Chlamydia STD online at the Center for Disease Control (CDC) website. Alternatively, you can also get this information from the Wikipedia.


To find detailed information about your sections Hazardous Waste program you should reference?

None of the above. OSHA STD 1910.120


How do you find results of scholarship of 4 STD?

how to find 4th std scholarship results of seat no.- m100226


What is c plus plus data type?

The C++ string classes are derived from the std::basic_string<T> template class, where T is a character type. The standard provides the two most common string types, std::string (std::basic_string<char>) and std::wstring (std::basic_string<wchar_t>). The former is used for ASCII strings (which includes UTF-8 strings) while the latter is used for wide-character strings, particularly UNICODE strings. All standard library strings are represented by an array of some character type (such as char or wchar_t) however, unlike an ordinary array, the individual character elements cannot be re-ordered other by overwriting each character. If you simply need an array of characters that can be re-ordered then use a std::vector<char> or std::vector<wchar_t> rather than a string. The standard library strings include a rich set of methods, operations and algorithms that are commonly used with strings, such as std::string::find() to locate a character within a string, std::string::substr() to extract a substring from a string, and operator+= to concatenate one string onto another. Most implementations include the short string optimisation so that short strings (up to around 14 characters or so) may be stored in local memory rather than on the heap. Many strings tend to be short so this can provide enormous performance benefits with little cost in terms of memory.


Why can't the c plus plus compiler find the string object?

The most likely reason that the C++ compiler can't find the string object is just that you've forgotten to include the string header file.Code Example:#include // so you can use C++ strings using namespace std; // so you can write 'string' instead of 'std::string' string sMyString; // declare a string