| 发表于:2008-01-23 10:14:57 楼主 |
//名字装框.cpp #include <iostream> #include <string> using namespace std; int main() { cout < < "please enter your name: "; string name; cin > > name; const string greeting = "hello, " + name + "!"; const string space(greeting.size(), ' '); const string second = "* " + space + " *"; -> const string first(second.size(), "*"); /*不能将参数 1 从“__w64 unsigned int”转换为“const std::basic_string <_elem,_traits,_ax> &”*/ cout < < endl < < first < < endl < < second < < endl < < "* " < < greeting < < " *" < < second < < endl < < first < < endl; system("pause"); return 0; } 为什么这样做错了? 高手指点 小弟初学 |
|
|
|
|