分类:
2010-12-02 17:05:41
eg1:
#include#include void printstring(const std::string& str) { std::cout << str << std::endl; } int main() { std::string str("Hello World"); printstring(str); }
eg2:
#include
#include
#include
using namespace std;
/* main: generate some simple output */
int main(void)
{
string ins;
cout<<"enter the string:";
cin>>ins;
cout<<"Hello:"< return 0;
}