getline 函数用法简介
来源:互联网 发布:东方网络复牌 编辑:程序博客网 时间:2024/05/13 00:14
#include<iostream>#include<cstring>#include<cstdio>using namespace std;//分开执行int main(){ string str1,str2;getline(cin,str1);//读取一行字符串,可读入空格cout<<str1<<endl;getline(cin,str2,'#');//读到以#作为分界符的一行字符串cout<<str2<<endl;char a[20];cin.getline(a,6);//读入5个字符到a中,以'\0'结尾,可读入空格cout<<a<<endl; char b[20];cin.getline(b,6,'@');//读入至多5个字符,或读到以‘@’标识的位置前cout<<b<<endl;return 0;}
0 0
- getline 函数用法简介
- getline函数的用法
- getline()函数的用法
- c++ getline()函数用法
- getline()函数的用法
- getline函数的用法
- C++中getline()函数简介
- C++中getline函数用法
- C++中getline函数用法
- 课件---getline()函数的用法
- C++中getline函数用法
- C++ getline()函数的用法
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- cin.get()cin.getline()getline()gets()等函数的用法
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- React Native在windows上android环境搭配及注意事项
- okhttp
- Apache Shiro 退出
- mysql学习笔记之连接查询与子查询
- 对图像进行卷积操作的意义!
- getline 函数用法简介
- HDU 5126 stars (CDQ分治)
- iOS基础:线程2-线程创建
- ios developer tiny share-20160711
- 安卓App热补丁动态修复技术介绍
- 切图psd to html页面制作技术学习与总结
- hdu 5201(隔板法+容斥原理)
- 浮点数表示
- 代码优化