1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Accessing private variables of a class

  1. Aug 6, 2010 #1
    how can i access the private variables of a class from another class?

    for example...
    Code (Text):

    class One{
         int array[6][7]    

    class Two{
         void printNumbers();

    void Two::printNumbers(){
         // i want to access the array in class One here
  2. jcsd
  3. Aug 6, 2010 #2


    User Avatar

    Staff: Mentor

  4. Aug 6, 2010 #3
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook