How do I declare a struct within a class?
<p>I want to declare a struct within a class which is private and I want to give a character value to a variable in the same struct, but I can't initialize it or cin it:</p>

<pre><code>class puple
{
private:
    struct p
    {
        char name[25];
        int grade;
    };
public:
    puple(){};
    void setme()
    {
        this-&gt;p::grade=99;
        this-&gt;p::name[25]='g';  //here is the problem
    }
    void printme()
    {
        cout&lt;&lt;"Name:  "&lt;&lt;this-&gt;p::name&lt;&lt;endl;
        cout&lt;&lt;"Grade:  "&lt;&lt;this-&gt;p::grade&lt;&lt;endl;
    }
};
void main()
{
    puple pu1;
    pu1.setme();
    pu1.printme();
}
</code></pre>
