c++读取和存储文件,对文件操作

#include
using namespace std;
int aa[100];//全局变量数组,用来接收我们从文件中读取的数据。 
void zhuanhua(string a){//这个函数的作用是转化我们读取的数字,由于我们读取文件时
                         //是按行读取,就是一下读取一行,读取的内容自动转化为字符串
						 //所以我们要想办法把字符串转为数字,顺便把空格空过去 
	int b=a.length();//获取字符串的长度 
	int c;
	string d="";
	int e=0;
	for(c=0;c

如果想在老版本的devc++使用stoi函数,参考这篇文章

如何在Dev-Cpp中使用C++11中的函数:stoi、to_string、unordered_map、unordered_set、auto_柳婼的博客-CSDN博客

你可能感兴趣的:(c++与数据结构系列,c++,开发语言,文件)