I would like to use strings in c++, but I couldn't. When I create strings, then I get always an error message. I would like to absolve the problem so if it is possible I don't want to use . (I don't know, how should I use with matrix strings)
Here is a small part of my code:
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
string fajlnev="tancrend.txt";
ifstream fajl(fajlnev.c_str());
int i=0;
int db=0;
string atmeneti;
while (!fajl.eof())
{
getline(fajl,atmeneti);
getline(fajl,atmeneti);
getline(fajl,atmeneti);
db++;
}
db--;
string tanc[db][3];
fajl.close();
ifstream fajl2(fajlnev.c_str());
for(i=0;i<db;i++)
{
fajl2>>tanc [i][0];
fajl2>>tanc [i][1];
fajl2>>tanc [i][2];
}