assertion failure on isalpha()

Hey I'm attempting to debug my program in Visual Studio, but I keep getting an assertion failure when running isalpha() on the char 'I'/0xcc/-52.

I've no idea where this character is coming from, and if I copy the contents of my input file to another text file and read that, it all goes well.

Please help, I can't find anything about this random, seemingly default character.

The text I'm using starts "just the place"
AFAIK isalpha should never assert. Are you sure that is what is going on?

what is the assertion failure you are getting?
Check that your file is not using some character encoding other that ASCII

From MSDN ( http://msdn.microsoft.com/en-us/library/xt82b8z8(VS.71).aspx ) :
When used with a debug CRT library, isalpha will display a CRT assert if passed a parameter that isn't EOF or in the range of 0 through 0xFF. When used with a debug CRT library, isalpha will use the parameter as an index into an array, with undefined results if the parameter isn't EOF or in the range of 0 through 0xFF.

Last edited on
The weird 'I' character is what shows up (in VC++) when there is garbage data in the string/stream. Make sure that your data is in there correctly and there is not extra garbage data in there (perhaps from copying a array in or something).
closed account (z05DSL3A)
This may help:
Bug Check 0xCC: PAGE_FAULT_IN_FREED_SPECIAL_POOL
The PAGE_FAULT_IN_FREED_SPECIAL_POOL bug check has a value of 0x000000CC. This indicates that the system has referenced memory which was earlier freed.
well according to the error the assertion comes from line 56 of istype.c, but I think this must be a default value VC++ puts in in debug mode, because in release mode it doesn't come up with the error, it just does nothing.

Is there anything wrong with my allocation line:

WordStream::inFile.get(lookingAt);
?
Topic archived. No new replies allowed.