由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ read matrix from txt file
相关主题
how to read a sentence into a vector of string?C++读文本文件怎么判断换行?
关于文件读取的C++ 问题?C++如何输入的一个小问题
C++ string类输入数据的问题C++ Q13: Input
问个C/C++题目C++ 屏幕输入问题
New C++ programmer, need to ask a I/O file read questionLinux下C++如何快速返回超大文件的某一行字符串?
C++ string to int Problem输入输出流,stl,api精通各需要多长时间?
请教一个C++关于输入输出的问题请教一个C++的问题
help on string parse所谓FP就是 递归+pattern matching?
相关话题的讨论汇总
话题: 2d话题: vector话题: txt话题: matrix话题: read
进入Programming版参与讨论
1 (共1页)
i****m
发帖数: 15
1
How to write a code to read the following matrix (in a .txt file):
R N A X M A
M E O Z T K
G D C C W R
K I A U C J
Q L C U R V
and store it in a 2D container, for example, a 2D vector:
vector< vector > CharMatrix;
Thanks a lot.
S*****n
发帖数: 227
2
看起来没有什么难度的事情啊?除了矩阵的信息也许需要先处理meta-data
读矩阵就 ifs >> std::skipws >> ch; 慢慢读吧,怎么了?

【在 i****m 的大作中提到】
: How to write a code to read the following matrix (in a .txt file):
: R N A X M A
: M E O Z T K
: G D C C W R
: K I A U C J
: Q L C U R V
: and store it in a 2D container, for example, a 2D vector:
: vector< vector > CharMatrix;
: Thanks a lot.

d******g
发帖数: 27
3
能先用 getline, 再用strtok么?
1 (共1页)
进入Programming版参与讨论
相关主题
所谓FP就是 递归+pattern matching?New C++ programmer, need to ask a I/O file read question
C++ 在 windows 上 结果正确, 在 linux 上结果总是不一样,怎C++ string to int Problem
读取数据求教请教一个C++关于输入输出的问题
问个关于cin的问题help on string parse
how to read a sentence into a vector of string?C++读文本文件怎么判断换行?
关于文件读取的C++ 问题?C++如何输入的一个小问题
C++ string类输入数据的问题C++ Q13: Input
问个C/C++题目C++ 屏幕输入问题
相关话题的讨论汇总
话题: 2d话题: vector话题: txt话题: matrix话题: read