Mail Archives: djgpp/1997/06/29/11:19:31
This is a multi-part message in MIME format.
------=_NextPart_000_01BC8414.A2CEB780
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Actually the compiler isn't doing anything wrong. You need to flush the
buffer after printing. I think it is something like this
printf("Hello world"); fflush(stdout);
getch();
Justin Talbot <stevetalbot AT sandiegoca DOT ncr DOT com> wrote in article
<33B59082 DOT F71 AT sandiegoca DOT ncr DOT com>...
> Two problems:
>
> First if I compile and run a simple program:
> void main(void)
> {
> printf("Hello world");
> getch();
> }
> The computer waits for me to press a key, then prints "Hello world",
> then ends. The compiler esentially switches the two function calls.
> This also happens if I place two getch()s after the printf() statement,
> except it waits for two key presses before printing "Hello world."
>
> Am I doing something very wrong? Is this a known problem with the
> compiler? Or is this something wrong with my copy?
>
> Second, is there a way to use the Intel ASM command 'shl eax,16' in AT&T
> syntax?
>
> Any help would be appreciated.
>
> Justin Talbot
>
------=_NextPart_000_01BC8414.A2CEB780
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<html><head></head><BODY bgcolor=3D"#C8E0D8"><p><font size=3D2 =
color=3D"#000000" face=3D"Arial">Actually the compiler isn't doing =
anything wrong. You need to flush the buffer after printing. =
I think it is something like this<br> printf("Hello =
world"); fflush(stdout);<br> getch();<br><br><br><br>Justin =
Talbot <<font =
color=3D"#0000FF"><u>stevetalbot AT sandiegoca DOT ncr DOT com</u><font =
color=3D"#000000">> wrote in article <<font =
color=3D"#0000FF"><u>33B59082 DOT F71 AT sandiegoca DOT ncr DOT com</u><font =
color=3D"#000000">>...<br>> Two problems:<br>> <br>> First =
if I compile and run a simple program:<br>> void main(void)<br>> =
{<br>> 	printf("Hello world");<br>> =
	getch();<br>> }<br>> The computer waits for me to press a =
key, then prints "Hello world",<br>> then ends. The =
compiler esentially switches the two function calls. <br>> This also =
happens if I place two getch()s after the printf() statement,<br>> =
except it waits for two key presses before printing "Hello =
world."<br>> <br>> Am I doing something very wrong? Is this a =
known problem with the<br>> compiler? Or is this something wrong with =
my copy?<br>> <br>> Second, is there a way to use the Intel ASM =
command 'shl eax,16' in AT&T<br>> syntax?<br>> <br>> Any =
help would be appreciated.<br>> <br>> Justin Talbot<br>> </p>
</font></font></font></font></font></body></html>
------=_NextPart_000_01BC8414.A2CEB780--
- Raw text -