I'm working (well have been for the past few weeks) on a polynomial class to do different things between two polynomials: multiply, divide, get remainder, subtract, add. The coefficients are stored in a pointer to an array listed under private and the degree (also the amount of slots in the array) is stored as private as well. During definition of many functions, a lot of instances of the class are created/destroyed/modified via dynamic allocation etc. I've come up with a solution for the required program, but when I compile it, the program crashes half of the time, and works the other half of the time. Does this mean I have an error within the program, or could there be an error in the compiling process? Just curious..Thanks for any insight.

(by the way, compiler is Code::Blocks 8.02 and OS is windows 7...let me know if there's anything else you need)

Recommended Answers

All 3 Replies

Typically a program like this will crash if you are not deleting the memory after each run. Post the code and I will see what I can find.

>>Does this mean I have an error within the program,
Yes, your program is buggy. Coding and getting a clean compile is only about 25% the job of a programmer. The other 75% if fixing bugs.

>>or could there be an error in the compiling process?

Unlikely. Don't blame the compiler for your buggy program.

>>Does this mean I have an error within the program,
Yes, your program is buggy. Coding and getting a clean compile is only about 25% the job of a programmer. The other 75% if fixing bugs.

>>or could there be an error in the compiling process?

Unlikely. Don't blame the compiler for your buggy program.

Thanks for the reply. I don't know much about the compiling process/different compilers. I just use the compiler I'm told to, and the coding is enough for me to handle. I figured it was an error, but wishful thinking made me ask this :-/.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.