string str;if(str.empty())
cout<<"str is NULL."<<endl;else
cout<<"str is not NULL."<<endl;//判断字符串是否为空串
cout<<"str's size is "<<str.size()<<endl;//返回当前字符串的大小
cout<<"str's capacity is "<<str.capacity()<<endl;//返回当前容量
cout<<"str's length is "<<str.length()<<endl;//返回当前字符串的长度
str.resize(20,'c');//把字符串当前大小置为len,多去少补,多出的字符c填充不足的部分
str.erase(3,3);//删除p开始的n个字符,返回修改后的字符串
str.insert(0,"123");//在p位置插入字符串s
str.append("123");//把字符串连接到当前字符串结尾
str.push_back('A');//当前字符串尾部加一个字符c
str.replace(0,3,"hello")//删除从p开始的n个字符,然后在p处插入串s
str.substr(5,7);//返回pos开始的n个字符组成的字符串
str.swap(str2);//交换当前字符串与str2的值
stack
stack<int> st;//创建
st.push(a);//入栈
a = st.top();//返回最上层元素
st.pop();//出栈(删除最上面元素)bool b = st.empty();//判断栈是否为空
a = st.size();//返回栈长度
queue
queue<int> que;//创建
que.push(a);//进队
a = que.front();//返回队头
a = que.back();//返回队尾
que.pop();//出队bool b = que.empty();//队列是否为空
a = que.size();//返回队列长度