How to compare a string with a struct (which include strings too)? : <p>so im working on my project and i have problem.</p>

<p>This is my struct:</p>

<pre><code>struct adminst {
string usernameadmin;
int passwordadmin;
</code></pre>

<p>and its another function:</p>

<pre><code>void adminlogin() {
string username, password;
adminst Username[100];
cout &lt;&lt; "Please enter your username";
cin &gt;&gt; username;
ifstream admin("adminha.txt");
for (int i = 1; i &lt; 100; i++) {
    admin &gt;&gt; Username[i].usernameadmin;
    if ((Username[i].compare(username)) &lt; 0)
}
</code></pre>

<p>and i also used:</p>

<pre><code>strcmp( Username[i],usernameadmin) == 0
</code></pre>

<p>but didnt get any answers.
I would be happy if you fix my code.</p>
