首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

待 哪位帮帮小弟我

2012-03-24 
在线等待 哪位大虾帮帮我 啊C++取子字符串的函数是什么,具体怎么用啊,头文件是什么?初级问题,各位大虾帮帮

在线等待 哪位大虾帮帮我 啊
C++取子字符串的函数是什么,具体怎么用啊,头文件是什么?       初级问题,各位大虾帮帮忙

[解决办法]
具体用法我给你举个小例子在下面,运行成功

#include <string>
#include <iostream>
using namespace std;

int main()
{
string str( "hello world ");
string strnew;
strnew=str.substr(6); //取str也就是hello world里的world,即从第6个位置开始取,赋给
cout < <strnew < <endl; //strnew
getchar();
return 0;
}

热点排行