class std::vector has no member named
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;

using namespace std;

struct coffeeBean
{   
    string name; 
    string country;
    int strength;
};  

std::vector&lt;coffeeBean&gt; coffee_vec[4];

int main(int argc, char ** argv)
{
    coffee_vec[1].name;
    return 0;
}
</code></pre>

<p>When I try to run this code I get <code>'class std::vector&lt;coffeeBean&gt;' has no member named 'name'</code>
I thought we can access the struct this way. Am I doing something wrong? </p>