标准输出流函数
来源:互联网 发布:python socket通信框架 编辑:程序博客网 时间:2024/05/21 20:58
put 函数
#include<iostream>using namespace std;int main(){char *a = "BASIC";for (int i = 4; i >= 0; i--){cout.put(*(a + i));}cout.put('\n');system("pause");return 0;}输出结果:
putchar 函数
#include<iostream>using namespace std;int main(){char *a = "BASIC";for (int i = 4; i >= 0; i--){putchar(*(a + i));}putchar('\n');system("pause");return 0;}输出结果:
getline 函数
#include<iostream>using namespace std;int main(){char ch[20];cout << "enter a sentence:" << endl;cin >> ch;cout << "The string read with cin is; " << ch << endl;cin.getline(ch, 20, '/');cout << "The second part is; " << ch << endl;cin.getline(ch, 20);cout << "The third part is; " << ch << endl;system("pause"); return 0;}
输出结果:
#include<iostream>using namespace std;int main(){float grade;cout << "enter grade:";while (cin >> grade){if(grade >= 85){cout << grade << "GOOD!" << endl;}if(grade < 60){cout << grade << "FAIL!" << endl;}cout << "enter grade:";}cout << "the end" << endl;system("pause");return 0;}
- 标准输出流函数
- 标准输出函数printf
- 标准输出流
- 关于流文件输出cout与标准输出函数printf的区别
- 标准输出函数cout(转载)
- C语言标准输出函数 printf()
- 重定义标准输出流
- ConsoleAppender 控制台标准输出流
- C++标准输出流详解
- 改变标准输入 输出流
- 七、输入/输出流--IOStreamm基本类和标准IOStream对象--未格式化输入和输出函数
- 标准输出
- 标准输出,标准错误输出
- dup2函数运用之重定向标准输出
- APUE之dup,dup2函数重定向标准输出实例
- IO —— 标准输入流和标准输出流
- 【我的Java笔记】标准输入和标准输出流
- Standard iostreams 标准输入、输出流
- JDBC 连接字符串大全
- three.js 绕其边缘旋转
- 数据库和代码程序间的数据类型选择
- PyMongo小总结
- webkit idl 资料
- 标准输出流函数
- Android修改系统时间 & apk获取系统权限
- W3C Web IDL
- string, wstring 转换, _wtol等
- 《水墨青花》----徐志摩
- what is the WIFI protocols set?
- 十个夺命的喝水坏习惯
- NAS网络硬盘使用小问题
- Core Java第二章知识点总结(二)