From: matthew DOT krause AT juno DOT com To: thruska AT tir DOT com Cc: djgpp AT delorie DOT com Date: Fri, 28 Aug 1998 09:53:18 -0400 Subject: Re: Display question... Message-ID: <19980828.103847.3926.4.matthew.krause@juno.com> Precedence: bulk >I'm new to this mailing list (but I'm on about 8 others, so it's nothing >really new to me how things work). That's gotta be a motherload of mail :>) > Anyway, I have a problem with the >printf command. When I do something like: > printf("Hello World!"); >It won't print anything to the screen until either the program is finished >or until a newline character is printed. Yeah. Printf is ?buffered? or something so to get your message to be printed out, you must say printf("Hello World!\n); the \n is a newline character (It might be ASCII 110 IIRC). If your use cprintf (from conio.h) you need to say \r\n for the carriage Return and New line. Alternatively, if you need the cursor to stay on the same line, you could do something like: #include int main() { printf("Hello World"); fflush(stdout); return 0; } Basically, what this does is put the string "Hello World" into a buiffer, which fflush then dumps to stdout (ie the screen.) _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]