c++程序设计string类成员函数是什么

 我来答
longinus_dean
2011-12-21 · TA获得超过2282个赞
知道小有建树答主
回答量:1097
采纳率:50%
帮助的人:1554万
展开全部
String constructors create strings from arrays of characters and other strings
String operators concatenate strings, assign strings, use strings for I/O, compare strings
append append characters and strings onto a string
assign give a string values from strings of characters and other C++ strings
at returns an element at a specific location
begin returns an iterator to the beginning of the string
c_str returns a non-modifiable standard C character array version of the string
capacity returns the number of elements that the string can hold
clear removes all elements from the string
compare compares two strings
copy copies characters from a string into an array
data returns a pointer to the first character of a string
empty true if the string has no elements
end returns an iterator just past the last element of a string
erase removes elements from a string
find find characters in the string
find_first_not_of find first absence of characters
find_first_of find first occurrence of characters
find_last_not_of find last absence of characters
find_last_of find last occurrence of characters
getline read data from an I/O stream into a string
insert insert characters into a string
length returns the length of the string
max_size returns the maximum number of elements that the string can hold
push_back add an element to the end of the string
rbegin returns a reverse_iterator to the end of the string
rend returns a reverse_iterator to the beginning of the string
replace replace characters in the string
reserve sets the minimum capacity of the string
resize change the size of the string
rfind find the last occurrence of a substring
size returns the number of items in the string
substr returns a certain substring
swap swap the contents of this string with another
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名_热心网友
2012-01-04 · TA获得超过719个赞
知道大有可为答主
回答量:3827
采纳率:0%
帮助的人:8575万
展开全部
void tongji(node*head) //统计男女职工人数的函数
{ int i=0,j=0;
node *p;
p=head;
while(p!=NULL)
{ if(p->sex=='m'||p->sex=='M')i++;
if(p->sex=='f'||p->sex=='F')j++;
p=p->next;}
cout<<"男职工人数为:"<<i<<endl;
cout<<"女职工人数为:"<<j<<endl;}
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式