来自.txt文件的数据写入数组 [英] Data from .txt file write in array

查看:78
本文介绍了来自.txt文件的数据写入数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自.txt文件的数据写入数组。

Data from .txt file write in array.

I need to read a .txt file in to an array.
exaple of one line in the .txt file:
lastname, prename, town, and so on.
i need to insert every word in another place in the array.

How can i make this?
Thanks a lot

推荐答案

当您使用MFC时,您可以使用 CStringT :: Tokenize [ ^ ]使用逗号(,)分隔您在单独的单词中读取的每一行。

然后您可以将每个单词放入使用循环的数组。
As you are using MFC, you can use CStringT::Tokenize[^] to split every line you read in separate words using the comma (,).
Then you can place each word in the array using a loop.


看看这个:在MFC中读取和写入CSV文件 [ ^ ]


这篇关于来自.txt文件的数据写入数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆