腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(5901)
视频
沙龙
1
回答
在c++中快速解析制表符分隔的字符串和in
、
、
、
、
在我的原始代码中,我将数据解析为如下所示的结构向量
std
::string name; int occurences;int volcount;
std
::vector<datastruct> data;
浏览 1
提问于2016-08-27
得票数 0
回答已采纳
6
回答
std
::
ifstream
比文件
慢
吗
?
、
、
、
我被告知,我的库比它应该的要
慢
,因为30+时间太慢,解析一个特定的文件(文本文件,大小为326 kb)。用户建议我使用的可能是
std
::
ifstream
(大概不是
FILE
)。无论如何,即使在这个大小的情况下,
ifstream
似乎也不会缓冲整个文件。
浏览 3
提问于2009-01-25
得票数 14
回答已采纳
1
回答
如何使用__int8中的filestream正确地将未签名的__int8数组读写到二进制文件中
、
:string outputFileName, int length, bool UseEntireRange, int max) {
file
.open(outputFileName,
std
::
ifstream
::out |
std
::
ifstream
::binary); unsigned __int8*{
std
::
ifstrea
浏览 1
提问于2016-08-05
得票数 0
回答已采纳
3
回答
我想知道有没有什么函数或方法可以先检查文件是否创建
我想知道有没有什么函数或方法可以先检查是否创建了文件,是否创建了读取信息,否则跳过读取文件的过程。
浏览 2
提问于2014-01-07
得票数 0
4
回答
如何将字符串转换为
ifstream
、
我正在尝试用
ifstream
打开一个文件,我想使用一个字符串作为路径(我的程序创建了一个字符串路径)。它可以编译,但它保持为空。string path = NameOfTheFile; // it would be something close to "c:\
file
\textfile.txt"//
i
浏览 0
提问于2011-02-03
得票数 4
回答已采纳
1
回答
将文件加载到vector<unsigned char>中
、
这个问题非常类似
于
;但是,在本例中,我想将它加载到一个无符号字符的向量中。
std
::
ifstream
file
;
file
.exceptions(
std
::
ifstream
浏览 0
提问于2012-04-17
得票数 2
回答已采纳
4
回答
编译C++代码时出错(无效转换)
、
、
、
、
在编译下面的文件时,我得到了从void* 到
FILE
*错误的无效转换。它以文件名为参数,尝试打开文件,如果文件打开,则返回文件指针,否则返回#include <fstream>{ <e
浏览 0
提问于2013-09-25
得票数 1
回答已采纳
1
回答
boost::pool_allocator
明显
慢
于
std
::allocator
、
、
根据的说法,我做了一个关于时间成本的小测试:void test() using namespace
std
::chrono; for (int i = 0; i < 1000; ++i) { cout << "time cost: " <
浏览 5
提问于2022-02-10
得票数 1
回答已采纳
3
回答
在这个文件流中抛出异常是什么?
、
std
::string accnts_input_
file
= "absolute_path/account_storage.txt";
std
::
ifstream
istream;{ istream.ope
浏览 0
提问于2014-06-25
得票数 6
回答已采纳
2
回答
basic_filebuf::underflow在/proc/pid/stat上读取
ifstream
文件时出错
、
、
// Checked that
file
does exist
std
::
ifstream
file
(path.c_str()); // Read the stream into many fields // !!
浏览 4
提问于2013-08-06
得票数 5
1
回答
成员变量的意外迭代器行为
、
、
、
我在迭代器方面有问题: private: Foo(
std
::string filepath) { it_ =
std
::istream_iterator<char>(
file
); char Next()=
std
::ist
浏览 2
提问于2022-04-22
得票数 0
回答已采纳
4
回答
如何将不同文件的内容写入到一个向量中,以便进一步使用getline
、
、
、
我想将不同文件的内容保存到一个向量中: Vector(0) = content
File
1 Vector(1) = Content
File
2 ...
浏览 0
提问于2011-04-08
得票数 0
回答已采纳
1
回答
读取和维护输入流堆栈
、
、
std
::
ifstream
* currentStream = fileStream; stack<
std
::
ifstream
*> fileStack = stack<
std
::
ifstream
*>(); if
浏览 0
提问于2017-03-30
得票数 0
回答已采纳
2
回答
循环退出后,字符串的内容将被删除
吗
?
、
、
、
、
我通过使用
std
::cout行来确定这一点。我相信这是一个范围问题,但我不知道如何解决。下面是有关这个问题的代码,任何提示或帮助都将不胜感激!
std
::string str; getline(
file
, str);
浏览 1
提问于2016-09-24
得票数 1
回答已采纳
2
回答
使用
ifstream
读取文件
、
、
、
:字3.5{ test 13.5 12.3 testing 145.4 }
ifstream
inFile(fajl.c_str(),
ifstream
::in); 我基本上需要通过文件和一个“单词”(非白色字符)在当时。我 谢谢
浏览 5
提问于2009-10-25
得票数 2
回答已采纳
1
回答
如何合并不同文本列的多个列
、
、
我有多个文本文件,我从一个文本文件中分离出来,现在我想将它们与,分离的表单合并,但是列与序列合并。A man in the park data2.txtdata3.txtNo2data4.txtNo3data5.txtNo4如何使用将这些数据文件合并为逗号分隔值( )文件2,A
浏览 3
提问于2014-07-07
得票数 0
回答已采纳
4
回答
在二进制模式下打开
ifstream
是否需要ios::in?
、
in标志对象不是多余的
吗
?谢谢。
std
::
ifstream
file
1("one.bin",
std
::
ifstream
::in |
std
::
ifstream
::binary);
std
::
ifstream
file
2("two.bin",
std
::
ifstream
::binary);
浏览 0
提问于2011-09-19
得票数 8
回答已采纳
1
回答
文件名创建
Ifstream
对象时出错
、
有什么特别的原因会失败
吗
?
std
::string r = "Hej.whatever";
std
::
ifstream
file
((*p).c_str(),
std
::ios::in,
std
::ios::ate);
std
::
ifstream
file
((*p),
std
::
浏览 0
提问于2018-05-08
得票数 0
回答已采纳
1
回答
如何将全局变量传递到C++中的函数中?
、
、
、
、
std
::
ifstream
f; { parse_store(f, "student_grades.txt"); //thisfrom shutting down} parse_store函数解析txt文件,拆分每一行数据,然后将tokenized向量(类似
于
":<e
浏览 0
提问于2018-09-06
得票数 1
回答已采纳
4
回答
使用istream_iterator并从标准输入或文件中读取
、
、
、
我可以很容易地写出这个代码,并从标准输入中读取:#include <string>#include <iostream>#include <iterator> int main(int argc, char** a
浏览 15
提问于2009-12-16
得票数 6
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
腾讯会议
云直播
对象存储
活动推荐
运营活动
广告
关闭
领券