Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ACCESS FUNCTION OF ANOTHER CLASS

ACCESS FUNCTION OF ANOTHER CLASS

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Caoimh
    wrote on last edited by
    #1

    I'm trying to access function in a class which is defined in another class. I've tried to declare it as a friend, however this won't work for me. Suggestions much appreciated Kind Regards Caoimh

    P N 2 Replies Last reply
    0
    • C Caoimh

      I'm trying to access function in a class which is defined in another class. I've tried to declare it as a friend, however this won't work for me. Suggestions much appreciated Kind Regards Caoimh

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      First either make the methods in the other class as public, or declare ClassB(from the class you are trying to access) as friend in ClassA(whose methods you are trying to access) other way friendship does not work, its not mutual.:)


      MSN Messenger. prakashnadar@msn.com

      1 Reply Last reply
      0
      • C Caoimh

        I'm trying to access function in a class which is defined in another class. I've tried to declare it as a friend, however this won't work for me. Suggestions much appreciated Kind Regards Caoimh

        N Offline
        N Offline
        Navin
        wrote on last edited by
        #3

        Could you post some example code? Too vague a question to really know what's going on. Remember, even if you win the rat race, you're still a rat.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups