1. ## A question about Vectors

Hello i have a string vector which contains something like this 1 2 3 a b 4 -1 seperatly.

String vector displays 1 as 1, 2 as 2, a as a(for sure) but it does not display -1 properly. When i cout -1 value, it displays something like û1 this.

I have to write a if statement when -1 equals something. what should i write

if(a == here), to work.

Thanks!

2. Why not show the code?

3. I did not redesign my functions yet. I just want to solve my problem first. What i want to do is in the vector array when it sees -1 understand that a new line is beginning.

My input file dfa.txt is:

0 0 1 a -1
1 0 3 a 2 b -1
-1

Code:
```#include <iostream>
#include "graph.h"
#include <fstream>              // for ifstream
#include <string>
using namespace std;
#include "tvector.h"
#include "stdlib.h"

template <class T>
void PutInputToArray(ifstream &dfa,tvector<T> &v)
{
T word;

while(dfa >> word)
{
if(word == "-1")
{
cout<<"hey"<<endl;
}
v.push_back(word);

}

}

void GetIntVal(string &strConvert, int &i) {

i = atoi(strConvert.c_str());

}

int main() {
Graph myGraph;

tvector<string> v;

ifstream dfa;
string file="dfa.txt";

int NumberofStatesInt;
int j=0;

dfa.open(file.c_str());
PutInputToArray(dfa,v);
string NumberofStates = v[0];

GetIntVal(NumberofStates,NumberofStatesInt);

for(j; j< NumberofStatesInt; j++)
{
}

int k = 2;
string first = v[2];
string second = v[4];
string second2 = v[6];
int firstint, secondint;

GetIntVal(first,firstint);
GetIntVal(second,secondint);

return 0;
}```