www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/22/18:45:38

From: Nicolas Blais <eletech AT netrover DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Conio's cprintf problem
Date: Sun, 22 Mar 1998 18:33:25 -0500
Organization: Elemental Technologies
Lines: 38
Message-ID: <35159FC4.DA455BCF@netrover.com>
References: <3 DOT 0 DOT 32 DOT 19980322221412 DOT 006a73cc AT uniserv DOT uniplan DOT it>
NNTP-Posting-Host: 198.168.87.13
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Compiler gives : Warning: Unkown escape code ("\c") and when I run hello.exe,
I see the c in the new line.

Angelo Pesce wrote:

> >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