Can anyone help me to let me know whats happening in the below code when ,;

as FYI,
data is an empty list created of type std::list
and the constructor definition given below is a copy constructor

LDAPControlSet::LDAPControlSet(const LDAPControlSet& cs){
    DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet(&)" << endl);;

thanks in advance

Copy constructor is invoke when you initialize an object with another.
In this case, it will be invoked something like this:

LDAPControlSet a;
//do something with 'a'.
LDAPControlSet b=a;//copy constructor invoked with 'a' as the argument
LDAPControlSet c;
c=b;// copy constructor *not* invoked but initialization operator invoked
LDAPControlSet d(a);//explicit invocation of the copy constructor with 'a'  as argument

When this copy constructor is called, it simply copies the content of the std::list cs::data to its own std::list data.
In the above example, a is passed as parameter to the copy constructor's parameter cs. is the std::list of that argument
and data is the std::list of the own object.

THanks Siddhant.

one more help,
actly i m trying to reproduce the segmentation fault in my code, please let me know whether the below code is capable of giving rise to that error or not or if not what should i do to this code.

int main()
        LDAPControlSet *cset = new LDAPControlSet();
        LDAPControlSet *cs = new LDAPControlSet("1");

        delete cs;;;

        cout<<"I am here";
        return 0;
This article has been dead for over six months. Start a new discussion instead.