0

hi everyone,

i have a constructor like this,

CStack(int n)
	{
		bottom_ = new char[n];
		top_ = bottom_;
		size_ = n;
	}

In my main class i call the constructor by creating a

CStack(5); // bottom_ =  new char [5];

my question is can increment the size of the stack by using a copy constructor?

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by Sky Diploma
0

I think a copy constructor as it name suggests creates a copy of the class-variable that is passed to it as a parameter/argument.

Unless the variable being passed has incremented the value.. I'm pretty unsure about it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.