[algogeeks] Re: Doubt in C++

2012-01-03 Thread Lucifer
@above.. This is what i assume is happening ( apart from inherent compiler optimization is any)...Let me know if i m wrong.. when s2=name; is done it should call the overloaded equal to operator.. But, 'name' is not a string object, its basically a char pointer to a const string test.. Now, for

Re: [algogeeks] Re: Doubt in C++

2012-01-03 Thread Arun Vishwanathan
@lucifer: ok so you are saying that the constructor implicitly creates a temporary 'string' object to hold this char string which is then assigned to s2. Does this mean that if a constructor function was not specified (unlike here where we have a parameterized constructor) this would not work or

[algogeeks] Re: Doubt in C++

2012-01-03 Thread Lucifer
@Arun... Basically what u have asked boils down to 2 questions... 1. First, this sort of assignment requires single parameterized constructor ? Yes ( and No as well in special cases.). But its not a mandate that the class defines... There is something called as implicit and explicit

Re: [algogeeks] Re: Doubt in C++

2012-01-03 Thread Arun Vishwanathan
@lucifer: thanks ! On Tue, Jan 3, 2012 at 9:02 AM, Lucifer sourabhd2...@gmail.com wrote: @Arun... Basically what u have asked boils down to 2 questions... 1. First, this sort of assignment requires single parameterized constructor ? Yes ( and No as well in special cases.). But its not a