Searching records from flatfile in C++
<p>I have written a snippet in C++ to search for record in a flatfile. The code does not work though. Below is the code i have written</p>

<pre><code>case 4:
    {
    cout&lt;&lt;"You Entered 4 (This Parses and searches BankAccount flatfile)"&lt;&lt;endl;

    inputFile&gt;&gt;SearchParam;
    cout&lt;&lt;"Enter Search criteria:"&lt;&lt;SearchParam;

        fstream inputFile; //file stream object
        inputFile.open("BankAccount.txt", ios::in);

    struct Bank
{
string AccountName;
string AccountNumber;
string AccountBalance;
}

//Array of bank record entries
Bank Details[20];
//Do until AccountName = SearchParam (Search by AccountName)
        i = 0;
        do{
getline(BankAccount, Details[i].AccountName,' ');
getline(BankAccount, Details[i].AccountNumber,' ');
getline(BankAccount, Details[i].AccountBalance,' ');
i++;
}
while (!BankAccount.eof()&amp;&amp; SearchParam != AccountName)
    }
    break;
</code></pre>
