i have to read and write a text file.
here is code. please help where i went wrong.
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <strstream>
#include <math.h>
#include <fstream>
#include <conio.h>
using namespace std;
vector<vector<string>>mvec;
void allocatemvecmemory()
{
mvec.resize(39333);
for(int i=0; i<39333; i++)
{
mvec[i].resize(6);
}
}
void getInputFile()
{
double x;
ifstream infile;
infile.open("input.txt");
if(!infile)
{
cout<<"error accessing input.txt file"<<endl;
}
else{
for(int i=0; i<39333; i++)
{
for(int j=0; j<6;j++)
{
infile>>mvec[i][j];
}
}
}
infile.close();
}
warning message saying that.
the is a built error. before declaring string vector it was working to read and write int variabl e.