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

做网站交互效果用什么软件采集网站后台数据

做网站交互效果用什么软件,采集网站后台数据,如何申请一个网站域名,做网站好做吗声明#xff1a;我个人特别讨厌#xff1a;收费专栏、关注博主才可阅读等行为#xff0c;推崇知识自由分享#xff0c;推崇开源精神#xff0c;呼吁你一起加入#xff0c;大家共同成长进步#xff01; 在文件读写的时候#xff0c;一般需要借助fstream来进行文件操作我个人特别讨厌收费专栏、关注博主才可阅读等行为推崇知识自由分享推崇开源精神呼吁你一起加入大家共同成长进步 在文件读写的时候一般需要借助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} }代码分析 seekg()用来设置stream的文件指针位置如in.seekg(14)就是将文件指针设置到14位置处相对begin位置这里相当于in.seekg(14, ios::beg)但是对于in.seekg(ios::end)却截然不同如stream3输出为2这是因为enum seekdir {beg, cur, end}所以当使用ios::cur和ios::end且只有一个参数的时候会将ios::cur隐式转换为1ios::end隐式转换为2所以stream3输出2stream12输出1这告诉我们当使用beg, cur, end为了避免错误请使用两个参数如in.seekg(0,ios::end)代替in.seekg(ios::end)tellg()没啥好说的就是返回文件流指针所在位置 声明我个人特别讨厌收费专栏、关注博主才可阅读等行为推崇知识自由分享推崇开源精神呼吁你一起加入大家共同成长进步
http://www.yutouwan.com/news/462931/

相关文章:

  • 在线网站建设询问报价上海阳性增多
  • 网站报价表格wordpress升级失败
  • php 手机网站开发wordpress 修订版本
  • 个人网站 免备案全国分站seo
  • 会议网站建设方案模板庆阳网站设计价格
  • 黄岛网站开发本地网站可以做吗?
  • 宝安区网站建设门户网站宣传方案
  • 做的公司网站风格跟样式和别人一样汉口网站建设 优帮云
  • 网站建设技术可行性越秀微网站建设
  • 哪个网站可以帮助做数学题无锡网络公司无锡网站推广
  • 清迈城市建设网站双控机制建设网站
  • 电脑做网站服务器需要什么软件立网站系
  • 展示型网站有哪些功能第八章 电子商务网站建设试题
  • 手工做耳环银材料哪个网站可以买到网站制作厦门
  • 晋江建设银行招聘网站保定网站公司那家好
  • 肇庆做网站的公司简单的网页设计论文
  • 建网站什么样的域名最好互联网公司是做什么的
  • mip网站建设房屋装修免费设计出图
  • 游戏网站建设邢台网络优化技术公司
  • 网站建设合同首付多少钱专做机械类毕业设计的网站
  • 合肥外贸网站推广厦门建设局网站改到哪
  • 视频网站做app还是h5网络工程规划与设计
  • 美橙表业手表网站怎么做才能让网站快速收录
  • 开源php建站系统竞价推广返点开户
  • dw做的网站怎么在vsphp 网站建设流程
  • 做网站工作怀孕wordpress 母婴类模板
  • 男女做爰视频网站在线好的设计作品网站
  • flash网站 seo100个万能营销方案
  • 双语版网站引导页学广告设计前景怎么样
  • 服务器建设网站软件下载空调维修技术支持东莞网站建设