title: Can a friend function change private data in the class?
body: <p>I would like to know if a friend function can change private data in the class without using a </p>
  
  <p>pointer and sending out the object. </p>
  
  <p>I mean does a friend function have access like a member function?</p>
  
  <p>For Example:</p>
  
  <pre><code>    class myinfo {
         private:
            char name[20];
            int id;
            float income;         
         public:
            void showInfo(void);
            myinfo(void);
            friend void updateInfo(myinfo);
  
        int main ( ) {
  
        myinfo j;
         updateInfo(j); // calling the friend function
  
     return 0;
  }
  
      void updateInfo(myinfo c) {
         strcat(c.name, ":updated");
         c.id++;
         c.income += 1.1;
  </code></pre>