www.digitalmars.com         C & C++   DMDScript  

c++ - cryptic command-line output

reply Jens Friese <j.friese highfisch.de> writes:
Hi,

command line output seems to be a tricky thing.
I try to write a few simple words to the command line,
and the result is SOMETIMES barely recognizable.

The following code:

	disp_printf("reading from txt file...");
	...
	disp_printf("done\n");
	disp_printf("dynamic memory allocation ...");
	...
	disp_printf("done\n");

result in this output:

"reading from txt file...26495033058122503ry allocation 
...033058122503ry allocation ....26395033058122503ry allocation"

COUT and CERR lead to similar (more or less crypic) results.
What could be the reason for this behaviour?

Regards, Jens
Sep 01 2002
parent "Walter" <walter digitalmars.com> writes:
Could be a pointer bug scrambling the text strings.

"Jens Friese" <j.friese highfisch.de> wrote in message
news:3D723885.20606 highfisch.de...
 Hi,

 command line output seems to be a tricky thing.
 I try to write a few simple words to the command line,
 and the result is SOMETIMES barely recognizable.

 The following code:

 disp_printf("reading from txt file...");
 ...
 disp_printf("done\n");
 disp_printf("dynamic memory allocation ...");
 ...
 disp_printf("done\n");

 result in this output:

 "reading from txt file...26495033058122503ry allocation
 ...033058122503ry allocation ....26395033058122503ry allocation"

 COUT and CERR lead to similar (more or less crypic) results.
 What could be the reason for this behaviour?

 Regards, Jens

Sep 01 2002