title: C++ class beginner
body: <p>How do you guys find the value of s.x from this code
  I am beginner of c++ and dont know how to solve it
  Please help thanks</p>
  
  <pre><code>// StarterLab.c : C Program to convert to C++
  //
  
  //#include "stdafx.h"       // required for Visual Studio
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  //#include "MemTracker.h"
  
  #pragma warning (disable:4996)
  
  using namespace std;
  
  struct variable
  {
  
  friend void showCalculation(variable a);
  
  private:
      int x;
      int y;
      int sum;
  
  public:
      void Calculate(int x,int y);
  
  };
  
  
  void showCalculation(variable a)
  {
      printf("%d",a.sum);
  };
  
  void variable:: Calculate (int x,int y)
  {
      sum = x + y;
  };
  
  int main ()
  {
  
      variable s;
      s.Calculate(7, 6);
      showCalculation(s);
      printf("%d",s.x);
  }
  </code></pre>
  
  <p>How do you guys find the value of s.x from this code
  I am beginner of c++ and dont know how to solve it
  Please help thanks</p>