16.5.1
来源:互联网 发布:linux 查看文件内容 编辑:程序博客网 时间:2024/06/07 04:44
/*
*Copyright(c) 2016.烟台大学计算机与控制工程学院
*ALL rights reserved.
*文件名称:main.cpp
*作者:孙超
*问题描述:阅读下面的程序
*/
#include <iostream>
#include <cstdlib>
#include <fstream> // (1)
using namespace std;
int main()
{
fstream file;
file.open("abc.txt", ios::in); // (2)
if(!file)
{
cout<<"abc.txt can’t open."<<endl;
exit(1);
}
char ch;
int i=0;
while(file.get(ch)) // (3)
{
++i; // (4)
}
cout<<"Character: "<<i<<endl;
file.close();// (5)
return 0;
}
*Copyright(c) 2016.烟台大学计算机与控制工程学院
*ALL rights reserved.
*文件名称:main.cpp
*作者:孙超
*问题描述:阅读下面的程序
*/
#include <iostream>
#include <cstdlib>
#include <fstream> // (1)
using namespace std;
int main()
{
fstream file;
file.open("abc.txt", ios::in); // (2)
if(!file)
{
cout<<"abc.txt can’t open."<<endl;
exit(1);
}
char ch;
int i=0;
while(file.get(ch)) // (3)
{
++i; // (4)
}
cout<<"Character: "<<i<<endl;
file.close();// (5)
return 0;
}
0 0
- 16.5.1
- 16.5.1 访问控制
- 16.5.1 创建一个状态机处理器
- IOS总体学习思路(16.5.1)
- PowerDesigner 16.5
- 16.5.7
- 16.5.2
- 精通COBOL--16.5.1 使用LINK命令进行程序调用
- 小白一键重装系统工具(一键GHOST) v8.16.5.1官方版
- 16.5 Type declarations
- 16.5 Apache安全配置
- 16.5.2 用户认证
- 16.5 消息并发传递
- 16.5 MFC WinSocket实例
- cadence allegro 16.5相关
- cadence 16.5 激活
- powerdesigner 16.5使用教程
- 16.5节练习
- BP算法改进
- 数据结构——栈的使用
- 工具类:自定义 pickerView
- RecyclerView的item点击事件
- IE11降级为IE8的方法
- 16.5.1
- GC调优在Spark应用中的实践
- Queue和Deque
- FAT12文件系统
- c#移位运算符("<<"及">>")详细说明
- 学习笔记之——RadioButton在XML文件便可实现点击切换样式
- 16.5.2
- Vulkan教程说明
- oracle substr,substrb ,instr,instrb函数的用法以及like的优化