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

一般app开发费用多少seo的研究对象

一般app开发费用多少,seo的研究对象,网站木马 代码,渠道营销包括哪些方面声明:我个人特别讨厌:收费专栏、关注博主才可阅读等行为,推崇知识自由分享,推崇开源精神,呼吁你一起加入,大家共同成长进步! 在文件读写的时候,一般需要借助fstream来进行文件操作&a…

声明:我个人特别讨厌:收费专栏、关注博主才可阅读等行为,推崇知识自由分享,推崇开源精神,呼吁你一起加入,大家共同成长进步!


在文件读写的时候,一般需要借助fstream来进行文件操作,常见的操作有seekg()和tellg(),但是这两个函数有一些需要注意的地方,如下:
主要参考:

https://stackoverflow.com/questions/20506771/get-file-size-with-ifstreamseekg-and-tellg
https://stackoverflow.com/questions/28823258/which-of-these-if-the-correct-way-to-use-seekg
https://stackoverflow.com/questions/11714973/istream-seekg-offsets-and-iosend

定义,参考cppreference
seekg: Sets input position indicator of the current associated streambuf object.中文的意思是:设置当前关联streambuf对象的输入位置指示器
tellg: Returns input position indicator of the current associated streambuf object.中文的意思是:返回当前关联streambuf对象的输入位置指示器

首先准备一个test.txt,每行15个字符,共45个字符

ssssssssssssss
aaaaaaaaaaaaaa
dddddddddddddd

测试程序:

#include <iostream>
#include "fstream"
using namespace std;int main() {int size = 0;std::string fileName = "../test.txt";ifstream in(fileName.c_str(), ifstream::in | ifstream::binary);if(in){in.seekg(0,ifstream::end);size = in.tellg();cout <<"********** size stream1*** =" << size << endl;  // ********** size stream1*** =44in.seekg(0,ios::end);size = in.tellg();cout <<"********** size stream2*** =" << size << endl; // ********** size stream2*** =44in.seekg(ios::end);size = in.tellg();cout <<"********** size stream3*** =" << size << endl; // ********** size stream3*** =2in.seekg(10,ios::end);size = in.tellg();cout <<"********** size stream4*** =" << size << endl; //  ********** size stream4*** =54in.seekg(-10,ios::end);size = in.tellg();cout <<"********** size stream5*** =" << size << endl; // ********** size stream5*** =34in.seekg(0,ios::beg);size = in.tellg();cout <<"********** size stream6*** =" << size << endl; // ********** size stream6*** =0in.seekg(ios::beg);size = in.tellg();cout <<"********** size stream7*** =" << size << endl; // ********** size stream7*** =0in.seekg(14);in.seekg(0, ios::end);size = in.tellg();cout <<"********** size stream8*** =" << size << endl; // ********** size stream8*** =44in.seekg(10);in.seekg(0, ios::cur);size = in.tellg();cout <<"********** size stream9*** =" << size << endl; // ********** size stream9*** =10in.seekg(ios::beg,ios::end);size = in.tellg();cout <<"********** size stream10*** =" << size << endl; // ********** size stream10*** =44in.seekg(ios::beg);in.seekg(ios::end);size = in.tellg();cout <<"********** size stream11*** =" << size << endl; // ********** size stream11*** =2in.seekg(ios::cur);size = in.tellg();cout <<"********** size stream12*** =" << size << endl; // ********** size stream12*** =1}
}

代码分析:

  1. seekg(),用来设置stream的文件指针位置,如in.seekg(14)就是将文件指针设置到14位置处(相对begin位置),这里相当于in.seekg(14, ios::beg),但是对于in.seekg(ios::end)却截然不同,如stream3输出为2,这是因为enum seekdir {beg, cur, end},所以当使用ios::curios::end且只有一个参数的时候,会将ios::cur隐式转换为1ios::end隐式转换为2,所以stream3输出2,stream12输出1,这告诉我们当使用beg, cur, end,为了避免错误,请使用两个参数,如in.seekg(0,ios::end)代替in.seekg(ios::end)
  2. tellg(),没啥好说的,就是返回文件流指针所在位置

声明:我个人特别讨厌:收费专栏、关注博主才可阅读等行为,推崇知识自由分享,推崇开源精神,呼吁你一起加入,大家共同成长进步!


http://www.yidumall.com/news/44007.html

相关文章:

  • 二手书市场网站建设项目规划表刷网站seo排名软件
  • dede网站搬家教程软文营销的特点
  • 梁平集团网站建设百度助手官网
  • 一站式做网站费用百度信息流推广
  • 优秀室内设计平面图seo优化标题 关键词
  • 软件开发师seogw
  • wordpress还原安装四川seo技术培训
  • 宁波专业网站搭建地址seo关键字优化软件
  • 做网站设计需要办理icp百度seo排名优化联系方式
  • 浏阳做网站推荐廊坊今日头条新闻
  • 东营的招聘网站哪个有用可以推广的软件
  • 网站图片做多大兰州网络推广公司哪家好
  • 织梦网站上传新闻商城小程序开发哪家好
  • 外贸网站源码网时代教育培训机构怎么样
  • wordpress 文章数seo优化是做什么的
  • 上海seo网站优化软件厦门谷歌seo
  • 学习做网站建设的学校谷歌搜索入口手机版
  • 自动做海报的网站做网站公司
  • 怎样把网站上传到服务器上磁力狗在线引擎
  • 网站模板有哪些内容奉节县关键词seo排名优化
  • 网站优化的常见问题百度站长平台官网
  • 国家示范建设成果网站大连网站制作
  • 西部数码网站管理控制面板天津百度推广排名优化
  • 景德镇网站制作千峰培训多少钱
  • 深圳做网站制作抖音seo排名系统
  • 如何用wordpress建一个网站百度网页电脑版入口
  • 网站上传文件大小限制淮北网站建设
  • 做微网站的公司外贸营销型网站制作公司
  • 2017网站建设前景怎么开发网站
  • 网站设计实施方案销售管理系统