my own type, print function
Torsten Mohr
tmohr at s.netic.de
Thu Sep 9 15:12:45 EDT 2004
Hi,
i have created an own type in C and have implemented
the print function for it.
static int mytype_print(mytype_obj* self, FILE* fp, int flags) {
printf("[%p]", fp);
fprintf(fp, "Hello, world\n");
}
At the moment i ignore "flags". The first line "printf" is
executed, fp is NOT Null. But i haven't yet explored the memory
at that location. At the moment it points to 7803BB68.
The second line "fprintf" crashes the program.
The command at 0x77f88216 points to 0x00000010. The action
"written" could not be executed. (I translated that from german).
If i delete the second line, the program runs normally,
as i'd expect it.
Can anybody give me a hint what could be wrong here?
Best regards,
Torsten.
More information about the Python-list
mailing list