title: Why friend function without argument is not working?
body: <pre><code> #include&lt;iostream&gt;
      using namespace std;
      
      class complex{
          private:
          int x;
      
          public:
          friend void fun(void);
      };
      
      void fun(void)
      {
          cout&lt;&lt;&quot;outside &quot;&lt;&lt;endl;
      }
      int main()
      {
          complex c1;
          c1.fun();
          return 0;
      }
  </code></pre>
  <p>why I'm getting the following error which says that 'class complex' has no member named 'fun' in VS code</p>
  <pre><code>36_friend_function.cpp: In function 'int main()':
  36_friend_function.cpp:19:8: error: 'class complex' has no member named 'fun'
       c1.fun();
          ^~~
  </code></pre>