面向对象程序设计c++.3.ppt

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 例3-27 下面的程序演示了获得string大小、长度和其它特性的string类的函数的使用。 #include iostream #include string using namespace std; void printStats( const string ); int main() { string s; cout Stats before input:\n; printStats( s ); cout \n\nEnter a string: ; cin s; // delimited by whitespace cout The string entered was: s; cout \nStats after input:\n; printStats( s ); s.resize( s.length() + 10 ); cout \n\nStats a

文档评论(0)

1亿VIP精品文档

相关文档