Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: 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
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook