how to find the longest string in an array of a class
<p>i have been browsing this site and i came across a question on finding the longest lastname in a class though i did not understand the question fully i tried to give it a go and i ended up getting stack...there are 3 classes human,teacher and student of which teacher and student inherits the properties of human my classes are like this (below),then we need to make an array of objects for lastnames in the human class since the teachers and students are humans,from that we create a method that checks the longest lastname between teachers and students inside the human class this is what i came up with..</p>

<pre><code>class human{
            public:
            char* firstname;
            char* lastname;


     string Big(human[]humans){

                string result ="";
                int i = 0;
                for (int i=0; i &lt; size(humans);i ++){

                    if (strlen(humans[i] &gt; strlen(res))

                    result = humans[i];

                }
    };

    class teacher:public human{
            public:
            int card_number;
    }

    class student:public human{
            public:
            int studen_num;
    }
</code></pre>

<p>i want to pass the array as an argument in the Big function but its not working,how can i pass do this,im just a newbie and i really want to solve this question of which i am failing any help i would greatly appreciate</p>
