Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Error for stati...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 43961 of 47562
Post > Topic >>

Error for static variable under private section

by Pallav singh <singh.pallav@[EMAIL PROTECTED] > Mar 17, 2008 at 11:44 PM

Hi  All

why i am getting error for static variable under private section

class Test
    {
    private :
        static int s_private_int;
    public:
        static int s_public_int;
    };

    int main()
    {
        Test::s_public_int = 145;   // OK
        Test::s_private_int = 12;   // wrong, don't touch
                                    // the private parts
        return 0;
    }

Thanks
 




 5 Posts in Topic:
Error for static variable under private section
Pallav singh <singh.pa  2008-03-17 23:44:29 
Re: Error for static variable under private section
"Alf P. Steinbach&qu  2008-03-18 07:57:15 
Re: Error for static variable under private section
"Alf P. Steinbach&qu  2008-03-18 08:01:12 
Re: Error for static variable under private section
peter koch <peter.koch  2008-03-17 23:57:01 
Re: Error for static variable under private section
songli9447@[EMAIL PROTECT  2008-03-18 04:15:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:39:11 CDT 2008.