Understanding the effectiveness of std :: string

I am trying to learn a little more about C ++ strings.

consider

const char* cstring = "hello";
std::string string(cstring);

and

std::string string("hello");

Do I correctly assume that both store "hello" in the application's .data section, and then the bytes are copied to another area on the heap, where a pointer controlled by std :: string can access them?

How can I effectively store a really very long string? I kind of think of an application that reads data from a socket stream. I am afraid to concatenate many times. I could imagine using a linked list and cross that list.

The lines scared me for too long!

Any links, tips, explanations, further details will be extremely useful.

+5
source share
4

10 100 MB . , () /.

/, , : , member() - , , .

, " ", , , . , , . , . ( stl.)

, ( ) rope < > : , , . , " , , ". SGI STL.

+2

, , . , , . , , ACE . .

EDIT: ACE ACE_Message_Block, . ++, . - ACE .

Boost.Asio , ACE. Boost.Asio , , , ACE, Boost.Asio . - Boost.Asio, !


, - , Boost.Asio, , .

+2

, . .

. std::string - , char *. - .

std::string. , - . .

0

, , , a std::string basic_string<char>.

, , . std::string, , , . , - .

, , 3D- . , , 100 , , , Windows XP Pro (.)

?

0

All Articles