Results 1 to 11 of 11

Thread: static / friend functions

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195

    static / friend functions

    Is it possible to either...

    a) Allow a static member function to access private / protected members of the class
    b) Brings a friend function into the same namespace as the class it befriends

    Why? Because I want to do something like this:

    Code:
    CTextFile* text = CTextFile::LoadFile ("C:\\Test.txt");
    It's how I usually form loading functions in C# and I'm hoping to do something similar in C++. Is this possible? It just seems silly that a static member function can't access the private members of a class, even though it is a member.
    Last edited by Barguast; Jan 11th, 2006 at 10:30 AM.
    Using Visual Studio .NET 2005

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