//As long as there are data in the flat file,
while (!readFile.eof()){
//it will read the line from the flat file
line=read(readFile);
//if the line is not empty
if (line.length() > 0) {
pos = line.find("\t",0);//find the tab delimiter
if (pos != string::npos) // npos refers to the end of string
user_pass[count][0] = line.substr(0,pos); //Get username
user_pass[count][1] = line.substr(pos+1); //Get password
count++; // iteration
Do you implement the function "read" in another source file? There is no global function with that name in the standard library. There is a method in ifstream, but it is for unformatted input and does NOT read one line at a time.