当前位置: 首页 > news >正文

怎样查询网站是否备案营销型网站的类型有哪些

怎样查询网站是否备案,营销型网站的类型有哪些,铜陵网站建设,打开wordpress很慢在学习C文件流控制时(链接)我们知道C有一个标准库fstream 该库定义了三个数据类型 ofstream ifstream 和 fstream 在练习相应的案例时,seekg() 函数掌握的不是很好,后经过多次尝试,可以正常调用了 代码如下&#xff1…

在学习C++文件流控制时(链接)我们知道C++有一个标准库fstream
该库定义了三个数据类型 ofstream ifstream 和 fstream
在练习相应的案例时,seekg() 函数掌握的不是很好,后经过多次尝试,可以正常调用了

代码如下:

#include <fstream>
#include <iostream>
using namespace std;int main()
{char data[100]; 以写模式打开文件//ofstream outfile;//outfile.open("new.out");//cout << "Writing to the file" << endl;//cout << "Enter your name: ";//cin.getline(data, 100); 向文件写入用户输入的数据//outfile << data << endl;//cout << "Enter your name: ";//cin.getline(data, 100); 向文件写入用户输入的数据//outfile << data << endl;//cout << "Enter your name: ";//cin.getline(data, 100); 向文件写入用户输入的数据//outfile << data << endl;//cout << "Enter your name: ";//cin.getline(data, 100); 向文件写入用户输入的数据//outfile << data << endl;//cout << "Enter your name: ";//cin.getline(data, 100); 向文件写入用户输入的数据//outfile << data << endl;//cout << "Enter your name: ";//cin.getline(data, 100); 向文件写入用户输入的数据//outfile << data << endl;//cout << "Enter your age: ";//cin >> data;//cin.ignore(); 再次向文件写入用户输入的数据//outfile << data << endl; 关闭打开的文件//outfile.close();char ch;// 以读模式打开文件fstream infile;infile.open("new.out");cout << "Reading from the file" << endl;infile >> data;// 在屏幕上写入数据cout << data << endl;cout << infile.tellg() << endl;// 再次从文件读取数据,并显示它infile >> data;cout << data << endl;cout << "a line" << endl;cout << infile.tellg() << endl;infile.get(ch);cout << ch << endl;infile.seekg(0L, ios::cur);cout << infile.tellg() << endl;infile.get(ch);cout << ch << endl;6infile.seekg(-1L, ios::cur);cout << infile.tellg() << endl;infile.get(ch);cout << ch << endl;infile.seekg(-1L, ios::cur);cout << infile.tellg() << endl;infile.get(ch);cout << ch << endl;infile.seekg(-2L, ios::cur);cout << infile.tellg() << endl;infile.get(ch);cout << ch << endl;//cout << infile.rdbuf() << endl;cout << "a line" << endl;//1111infile.seekg(-3, ios::end);infile.get(ch);cout << ch << endl;//6infile.seekg(-8, ios::end);//infile.get(ch);//cout << ch << endl;cout << infile.rdbuf() ;//3infile.seekg(0, ios::beg);infile.get(ch);cout << ch << endl;cout << 'a line' << endl;// 关闭打开的文件infile.close();return 0;
}

这段代码前半段负责写入程序,后半段从文件中读取数据
需要注意以下几点:

  • 在读取文件时,实例化 fstream 和 ifstream 均可
  • 使用 infile.tellg() 追踪文件指针的位置
  • 使用 cout << infile.rdbuf() ; 输出指针所在处的整个单词
  • ios::cur 在当前指针位置处跳跃
  • ios::beg 从头开始跳跃
  • ios::end 从后往前遍历
  • 使用 ios::end 时,如果想向前遍历,需要输入负的步长
  • infile >> data; 整行输出
    关于 ios::cur 指针部分还是有点迷糊,可以先通过 infile.tellg() 考察指针移动情况,需要用到的时候再深入学习。
http://www.shuangfujiaoyu.com/news/27480.html

相关文章:

  • 网站页面外链怎么做seo自然搜索优化排名
  • 建设网站个人简介范文石家庄百度推广排名优化
  • 360做网站的营销型网站制作建设
  • 网站建设建站技术培训
  • wordpress企业网站开发seo辅助工具
  • 十堰网络公司排名慧达seo免登录发布
  • 宽城区网站建设电商代运营公司排名
  • 南昌做网站比较好的公司有哪些在线工具
  • 宿豫区城乡建设局网站网络推广运营优化
  • 网站内容设计怎么自己做一个网址
  • 河北省做网站的企业百度账号官网
  • 北京智能网站建设哪里好100个成功营销案例
  • 新建网站做优化8个公开大数据网站
  • 湖北企业网站优化排名沈阳seo排名优化教程
  • 网站数据库文件名网络广告的形式有哪些?
  • 做百度手机网站优化快深圳网络提速优化服务包
  • jsp动态网站开发实...广州seo排名收费
  • 校园微网站建设方案网站的优化seo
  • 做报表的网站百度快照首页
  • 做wish如何利用数据网站博客营销案例
  • 网站开发 外文文献小说引流推广
  • 全景网站是怎么做的网站没有友情链接
  • 外贸网站模版亚马逊关键词优化软件
  • 做名片的网站叫什么来着今日国际新闻最新消息
  • 网站换空间步骤网站alexa排名查询
  • 网站做深圳seo网站优化公司
  • 做的最好的视频教学网站宁波seo教程网
  • 晋州 网站建设 网络推广什么是精准营销
  • 正规网站开发公司免费seo排名网站
  • tp5做企业网站今日最新国内新闻重大事件