Alain Fallada wrote:
Can someone please post an exemple of a copy constructor for an array object in one class which is called in the main class to make exact copies of the existing array objects.
example to make copies of book[] which is in the class UsingBooks and the copy constructor would be in the class Books.
I have been searching for 2 days and i can not find this.
Alain Fallada wrote:Ok. can you show me just a simple example of a constructor method that would do just that.
I would really appreciate this.
Alain Fallada wrote:Can you please give me just an exemple of a regular method that would do this with an array object. i just want to have a model to work with.
thanks.
Alain Fallada wrote:I am sorry if this is too silly. I have an assignment and this is what they are asking me. To create a copy constructor method to create a couple of copies of an array object.
Alain Fallada wrote:
Alain Fallada wrote:
Maybe I should post the whole assignment so that it is easier to understand what they are asking us to do.
Alain Fallada wrote:Can someone please post an exemple of a copy constructor for an array object in one class which is called in the main class to make exact copies of the existing array objects.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Alain Fallada wrote:Hello, here is the assignment:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Alain Fallada wrote:- Your class should have a copy constructor, so new book objects can be created as exact copies of existing ones.
Alain Fallada wrote:Create an array of 10 books. All these books must be initialized with proper values; that is: title, price & ISBN. You must use the copy constructor to create some of these objects.
Alain Fallada wrote:Is this what i need to do?
...
Now. it always prints that it did not find the value that I am searching for.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Alain Fallada wrote:Now. it always prints that it did not find the value that I am searching for.
Paul Clapham wrote:
I think with more testing you might find that it doesn't print that message if the last book in the list is the one you're searching for.
I wasn't selected to go to mars. This tiny ad got in ahead of me:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|