[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging




> How can I create the debugging-errormessages, so that the programm says
> the line of the error?

Generally this is done in the same way as people do it in C, a bunch of
#define hackery involving the __FILE__ and __LINE__ macros. For instance:

#define PRINT_LOCATION() cout << __FILE__ << ':' << __LINE__ << endl;

That is a fairly crude example, it's possible to go to obscene lengths of
weirdness to get debug messages just the way you want them, and people
generally do :)

> I get the following error-message while trying to open a file:
> 	Invalid or incomplete multibyte or wide character

Be more specific, how are you opening this file, using an fstream? A
normal fstream, or one specialized for wchar? Have you played about with
the locale settings? Are you attempting to load this file in an editor? Is
it a binary file? (if it is, set ios::binary). Basically, not enough
information to help you here.

Michael