新手:关于string类的有关问题
新手:关于string类的问题
创建了一个string对象,用getline()输入时,如 "hello "
input:hello(回车)
(回车)
hello
(空行) //输入时两次回车才输入给对象,输出又同时输出两行,搞不清除为什么?
用#include <cctype>
toupper()可以实现string对象的大写转换吗?
C++ Primer中8.8第三题.
高手指点.
------解决方案--------------------
toupper()可以实现string对象的大写转换吗?
不能
------解决方案--------------------
transform+toupper可以将string转为大写。
创建了一个string对象,用getline()输入时,如 "hello "
input:hello(回车)
(回车)
hello
(空行) //输入时两次回车才输入给对象,输出又同时输出两行,搞不清除为什么?
用#include <cctype>
toupper()可以实现string对象的大写转换吗?
C++ Primer中8.8第三题.
高手指点.
------解决方案--------------------
toupper()可以实现string对象的大写转换吗?
不能
------解决方案--------------------
transform+toupper可以将string转为大写。