Windows error 0x000000EC, 236

Detailed Error Information

SESSION_HAS_VALID_SPECIAL_POOL_ON_EXIT[1]

This is a Blue Screen of Death stop code. More information is available in the Knowledge Base article Bug Check 0xEC: SESSION_HAS_VALID_SPECIAL_POOL_ON_EXIT.

HRESULT analysis[2]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.
FlagsSeveritySuccess

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[2][3]
DescriptionThe default facility code.[2][3]
Error Code236 (0x00ec)

Possible solutions

2

In which situation does function prototype have to include parameter names?

c
function

The code in your question has a number of bugs, many of which your compiler should have at least warned you about.

When I copied the code and compiled it using gcc, even without any additional arguments, the first error message was:

c.c: In function ‘main’:
c.c:16:5: warning: passing argument 2 of ‘itob’ makes integer from pointer without a cast [enabled by default]
     itob(n, line, i);
     ^
c.c:6:6: note: expected ‘char’ but argument is of type ‘char *’
 void itob(int , char , int );
      ^

The error message is correct. You declared itob with a second parameter of type char, then called it with a second parameter of type char* (resulting from the implicit conversion of the array line).

Later, you define itob with a second parameter of type char[] (which, since it's a parameter, is really of type char*). This is incompatible with the earlier declaration, and it should also have been flagged by your compiler.

To answer the question in your title, in a standalone prototype (one that's not part of the function definition), parameter names are optional. These two prototypes are equivalent and valid:

void itob(int, char, int);

and

void itob(int x, char y, int z);

Personally I like to specify parameter names just because it makes the code clearer.

For a prototype that's part of a function definition, the names are required, because that's how the parameter objects are defined.

But first, fix the errors in your code.

answered on Stack Overflow May 31, 2015 by Keith Thompson
1

Polynomial Class Crashes While Handling overloaded operator=

c++

You have both problems with constructor and copy constructor. Copy constructor is constructing object from nothing as normal constructor(but then it copies corresponding values from other object) so you shouldn't check a value there, just create it. There is no need in blank return operator. Also you have a problem with uncertancy of 0 and 1 size of a. This code would be more common:

Polynomial::Polynomial (const string& name) : Function(name) {
    a = 0;
    degree = 0;
}

Polynomial::Polynomial (const Polynomial& rhs) {

    setName(rhs.getName());
    degree = rhs.degree;
    if(degree)
    {
        a = new double[degree];
        for(int i = 0; i < degree; i++)
            a[i] = rhs.a[i];
    }
    else
        a = 0;
}

const Polynomial& Polynomial::operator=(const Polynomial& rhs) {
    if(this != &rhs)
    {
        if(a)
            delete [] a;
        setName(rhs.getName());
        degree = rhs.degree;
        a = new double[degree];
        for(int i = 0; i < degree; i++)
            a[i] = rhs.a[i];
    }
    return *this;
}
answered on Stack Overflow Nov 30, 2012 by Arsenii Fomin • edited Nov 30, 2012 by Arsenii Fomin
1

Polynomial Class Crashes While Handling overloaded operator=

c++

I think the problem is in your copy constructor, in your copy constructor you have:

//Null a, and then pass over to the overloaded = operator.
if(this->a)
    delete [] this->a;

But a is not initialized here, so you can't delete it, so replace it with:

Polynomial::Polynomial(Polynomial const& other) : a( NULL ) {...}
answered on Stack Overflow Nov 30, 2012 by BigBoss

Comments

Leave a comment

(plain text only)

Sources

  1. https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-code-reference2
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0