|
-
Dec 13th, 2005, 12:34 PM
#4
Thread Starter
Hyperactive Member
Re: Error Correction problem
the first thing I have noticed is that they are not in the same code block. {}
The driver class and the BookOrder class aren't in the same file.
you instantiate a new bookOrder object for each case in your loop?
definitely the bug is there.
That part of code is fine because when I remove the line of code that outputs the number of instances created the program works fine.
I tried moving the statement out of the while loop and it didn't work then but I understand why and that's because the variables that I'm passing to the class aren't created yet. However that rasies another point because it generates the same error when the statement is in the while block when the variables are created. (I'm talking about the statement that outputs the number of instances created) Does this mean that the instance of the BookOrder is terminated after the while block ends?
Edit:
The instance must end up being destroyed at the end of the while loop because I placed a bit of code into section of the while loop to output the number of instances created and it worked there but anytime I place the statement outside the loop it is not working.
Last edited by GamerMax5; Dec 13th, 2005 at 12:50 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|