有关std :: string的信息 [英] Info on std::string

查看:75
本文介绍了有关std :: string的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以请一个人给我一个不错的网站,给出一个

所有成员函数的详尽列表,

成员变量,std的运算符等: :字符串类,

以及每个工作原理的信息描述。


我在过去的20分钟内一直在尝试谷歌但是可以'' t $ / $
得到任何体面的东西。


谢谢。

-JKop

解决方案

* JKop< NU ** @ NULL.NULL>写道:

请一些人请指向一个不错的网站,提供所有成员函数,
成员变量,运算符等的详尽列表std :: string类,
以及每个如何工作的信息描述。



http://www.cppreference.com/

Martin


- -

你是匿名的吗?哪里? ......我不这么认为......


[devnull {at} chaosfactory {dot} org | http://www.chaosfactory.org/ ]


JKop写道:

可以请一个人指向一个不错的网站,提供所有成员函数的详尽清单, std :: string类的成员变量,运算符等,以及每个单元如何工作的信息描述。

我在过去的20分钟里一直在尝试谷歌不能得到任何体面的东西。

谢谢。

-JKop




你可能会想要尝试Dinkumware的C ++库参考:

http: //www.dinkumware.com/refxcpp.html

Best


Kai-Uwe Bux


JKop发布:

有人可以指点一个不错的网站给出一个n
std :: string类的所有成员函数,成员变量,运算符等的详尽列表,以及每个函数如何工作的信息描述。

谢谢。

-JKop



只是为了得到一件事:当你这样做:


string blah(" Hello !!");


分配新内存并且是Hello !!复制,是吗?


无论如何,我对std :: string是全新的,所以可以请一些人来评论我的

代码。目前它编译但它导致运行时访问

违规:

string& RemoveUnnecessarySpaces(string& input_string)

{

// ***开始时删除空格


while(input_string [0] =='''')input_string.erase(0,1);


// *** DONE在开始时删除空格

// ** *从末尾删除空格


while(input_string [input_string.length() - 1] =='''')

input_string.erase(input_string。 length()-1,1);


// *** DONE从末尾删除空格

// ***删除多个空格

for(string :: size_type i = 0 ;;)

{

i = input_string.find_first_of('''',i);


if(i == string :: npos)break;


++ i;


while (input_string [i] =='''')input_string.erase(i,1);


++ i;

}

// ***完成删除多个空格


}

-JKop


Can some-one please point me to a nice site that gives an
exhaustive list of all the memberfunctions,
membervariables, operators, etc. of the std::string class,
along with an informative description of how each works.

I''ve been trying Google for the last 20 minutes but can''t
get anything decent.

Thanks.
-JKop

解决方案

* JKop <NU**@NULL.NULL> wrote:

Can some-one please point me to a nice site that gives an
exhaustive list of all the memberfunctions,
membervariables, operators, etc. of the std::string class,
along with an informative description of how each works.



http://www.cppreference.com/

Martin

--
Are you Anonymous? Where? ... I don''t think so ...

[ devnull{at}chaosfactory{dot}org | http://www.chaosfactory.org/ ]


JKop wrote:

Can some-one please point me to a nice site that gives an
exhaustive list of all the memberfunctions,
membervariables, operators, etc. of the std::string class,
along with an informative description of how each works.

I''ve been trying Google for the last 20 minutes but can''t
get anything decent.

Thanks.
-JKop



You might want to try the C++ Library Reference from Dinkumware:

http://www.dinkumware.com/refxcpp.html

Best

Kai-Uwe Bux


JKop posted:

Can some-one please point me to a nice site that gives an
exhaustive list of all the memberfunctions,
membervariables, operators, etc. of the std::string class,
along with an informative description of how each works.

I''ve been trying Google for the last 20 minutes but can''t
get anything decent.

Thanks.
-JKop



Just to get one thing straight: When you do:

string blah("Hello!!");

Is new memory allocated and is "Hello!!" copied, yes?

Anyway, I''m brand-new to std::string, so can some-one please comment on my
following code. At the moment it compiles but it causes run-time access
violations:
string& RemoveUnnecessarySpaces(string& input_string)
{
// *** Remove spaces at start

while (input_string[0] == '' '') input_string.erase(0,1);

// *** DONE remove spaces at start
// *** Remove spaces from end

while (input_string[input_string.length() -1] == '' '')
input_string.erase(input_string.length() -1,1);

// *** DONE remove spaces from end
// *** Remove multiples spaces
for (string::size_type i = 0; ; )
{
i = input_string.find_first_of('' '', i);

if (i == string::npos) break;

++i;

while(input_string[i] == '' '') input_string.erase(i,1);

++i;
}
// *** DONE remove multiple spaces

}
-JKop


这篇关于有关std :: string的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆