Why can the following function access class member without being declared as friend or member function?
<p>Header file:</p>

<pre><code>// pe10-8arr.h -- header file for a simple list class

#ifndef SIMPLEST_
#define SIMPLEST_

// program-specific declarations
const int TSIZE = 45;      // size of array to hold title
struct film
{
    char title[TSIZE];
    int rating;
};

// general type definitions
typedef struct film Item;

const int MAXLIST = 10;
class simplist
{
private:
    Item items[MAXLIST];
    int count;
public:
    simplist(void);
 bool isempty(void);
 bool isfull(void);
    int itemcount();
 bool additem(Item item);
    void transverse( void (*pfun)(Item &amp;item));
};

#endif
</code></pre>

<p>Code using header:</p>

<pre><code>#include "pe10-8arr.h"

simplist::simplist(void)
{
    count = 0;
}

bool simplist::isempty(void)
{
    return count == 0;
}

bool simplist::isfull(void)
{
    return count == MAXLIST;
}

int simplist::itemcount()
{
    return count;
}
bool simplist::additem(Item item)
{
    if (count == MAXLIST)
        return false;
    else
        items[count++] = item;
    return true;
}

void simplist::transverse( void (*pfun)(Item &amp;item))
{
    for (int i = 0; i &lt; count; i++)
        (*pfun)(items[i]);
}

#include &lt;iostream&gt;
#include &lt;cstdlib&gt;         // prototype for exit()
#include "pe10-8arr.h"     // simple list class declaration
                                // array version
void showmovies(Item &amp;item); // to be used by transverse()

int main(void)
{
    using namespace std;
    simplist movies;     // creates an empty list
    Item temp;

    if (movies.isfull())    // invokes isfull() member function
    {
        cout &lt;&lt; "No more room in list! Bye!\n";
        exit(1);
    }
    cout &lt;&lt; "Enter first movie title:\n";
    while (cin.getline(temp.title,TSIZE) &amp;&amp; temp.title[0] != '\0')
    {
        cout &lt;&lt; "Enter your rating &lt;0-10&gt;: ";
        cin &gt;&gt; temp.rating;
        while(cin.get() != '\n')
            continue;
        if (movies.additem(temp) == false)
        {
            cout &lt;&lt; "List already is full!\n";
            break;
        }
        if (movies.isfull())
        {
            cout &lt;&lt; "You have filled the list.\n";
            break;
        }
        cout &lt;&lt; "Enter next movie title (empty line to stop):\n";
    }
    if (movies.isempty())
        cout &lt;&lt; "No data entered. ";
    else
    {
        cout &lt;&lt; "Here is the movie list:\n";
        movies.transverse(showmovies);
    }
    cout &lt;&lt; "Bye!\n";
    return 0;
}

void showmovies(Item &amp;item)
{
        std::cout &lt;&lt; "Movie: " &lt;&lt; item.title &lt;&lt; "  Rating: "
             &lt;&lt; item.rating &lt;&lt; std::endl;

}
</code></pre>

<p>The code above just compile and run successfully. Can anyone tell me why the function <code>showmovies()</code> can access the item member of <code>simplist</code> using reference without being declared as friend function or member function?</p>
