title: Access function from another class without having any relations
body: <p>I'm still new to C++ and I'm trying to know if it is possible to access a function from another class knowing that no one is the father class here . This is a piece of my program to show you what I want to do exactly .</p>
  <pre><code>class CSubject
  {
    public:
    CSubject() = default;
    CSubject(std::string m_Name){this-&gt;Name = m_Name;}
     void print(){ std::cout &lt;&lt; Name;}
     ~CSubject(){}
    private:
     std::string Name;
  };
  
  class CStudent
  {
    public:
    CStudent() = default;
    
     void Method2()
     {
         //Call the print method and print the name &quot;test&quot;
     }
     ~CStudent(){}
    private:
  };
  
  int main()
  {
      CSubject AE(&quot;test&quot;);
      CStudent ST;
  
      ST.Method2();          //Print test;
  
      return 0;
  }
  </code></pre>