Sponsored Links


Results 1 to 2 of 2

Thread: Pointers are not accessible for static member funcion

  1. #1
    Senior Member saneha's Avatar
    Join Date
    Apr 2011
    Posts
    266

    21 Pointers are not accessible for static member funcion

    Sponsored Links1



  2. #2
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578
    You know very well that an object has some characteristics as well as exhibit behavior. State of an object infect is the current value of its data members (characteristics).

    In case of deep copy constructors.......
    when an object initialize with an existing object's state, then a memory space is allocated to the newly created object. In order to understand this concept easily, please have a look to the statements given below.

    Shallow copy means like a "pass by value" e.g. a = b;

    deep copy means like a "pass by reference" e.g. a = &b;

    so, as you see in deep copy address is passing. In such a situation, problem is same memory location is pointed by different pointers due to address passing.

    "this" pointer can't access the static data members because these are class members rather than object. "this" pointer is related with object rather than class, that's why, unable to access static data members.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dangling Pointers Explain in C++
    By Vuhelper in forum C++ Programing
    Replies: 0
    Last Post: 05-31-2012, 01:52 AM
  2. why we have declared these two TreeNode pointers left
    By saneha in forum C++ Programing
    Replies: 1
    Last Post: 05-02-2011, 05:15 PM
  3. Replies: 1
    Last Post: 05-02-2011, 04:50 PM
  4. static member function can be declared explicitly?
    By saneha in forum C++ Programing
    Replies: 1
    Last Post: 05-02-2011, 06:56 AM
  5. Pointers in c++ 2011
    By saneha in forum C++ Programing
    Replies: 1
    Last Post: 05-02-2011, 06:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft | Jobs