www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/22/16:23:16

Message-Id: <3.0.32.19980322221412.006a73cc@uniserv.uniplan.it>
Date: Sun, 22 Mar 1998 22:21:37 +0100
To: djgpp AT delorie DOT com
From: Angelo Pesce <us0082 AT uniserv DOT uniplan DOT it>
Subject: Conio's cprintf problem
Mime-Version: 1.0

>Hi,  whenever I compile and run this code, the "World!" string is placed
>below the "Hello" but after the "o".  How do I make it got in the
>beggining of the line andenot and the end of Hello. Here's what it shows
>on the screen:
>
>Hello
>        World!

That's coz cprintf \n is only line feed but it doesn't perform a carridge
return. You should use \n\c instead (if I remember well)

>
>'--------------CODE-----------------------------------------
>#include <conio.h>
>#include <iostream.h>
>
>void main(void)
>{
> clrscr;
> textcolor(RED);
> cprintf("Hello\n");
> highvideo();
> cprintf("World!");
> textcolor(LIGHTGRAY);
> return(0);
>}
>
>
>
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019