CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    159

    Question How to reach a global function with the same name as a method

    Hi all,

    by coincidence I started thinking about how to reach a global function that has the same signature as a method. (I know this is bad design but let's leave that aside )

    Code:
    void test(){};
    
    Class::test(){};
    
    Class::test2()
    {
        test(); //calls Class::test() but how can I call the global function?
    }
    thanks, Jef

  2. #2
    Join Date
    Jul 2002
    Location
    Portsmouth. United Kingdom
    Posts
    2,727

    Re: How to reach a global function with the same name as a method

    Code:
    Class::test2()
    {
        ::test();
    }
    "It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
    Richard P. Feynman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured