Patrick wrote:

> I have written a short testprogram which is reading from a messageQ.
> The code is written in C.
> If i get a message the printf with the much ***** is comming ok but 
> afterwards the program chrashes...
> What is the problem with my code? Can somebody help me?

First of all: this is the wrong group, please ask such questions in 
fltk.general. fltk.development is for development of FLTK itself.

To your question: I don't see anything obvious. You mean that only the first 
"***..." line appears:

>       else
>               {
>               counter++;
>               
> printf("********************************************************************\n");

... this one above, but ...

>               printf("%05i Receive: mtype: %i, mtext: %i, message: 
> %s\n",counter, buf.mtype, buf.mtext, buf.message);

... not the output of the line above?

If that's true, I can imagine two possible reasons:

1. Your message is not zero-terminated. Chances are that the printf tries to 
output a string, and you access something on the stack that is not accessible.

2. The output is written, but your output stream is buffered, and thus you 
don't 
see it. Try to add

fflush(stdout);

after the print statement to verify this. If your program would crash later, it 
is possible that the buffered output would be discarded.

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to