Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Tobias Ernst <tobi@bland.fido.de>
Subject: Re: Dec C pecularity
Date: 1999/06/13	[thread overview]
Message-ID: <87hfocxypx.fsf@romulus.bland.fido.de> (raw)
In-Reply-To: 37614C91.3FBFAB0A@zk3.dec.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

Hello,

seeing that you really seem to care about removing Dec C peculiarities, there
is another one which has bothered me numerous times:

  #include <stdio.h>
  int main(void)
  {
      printf ("\x1B[2JThe screen is cleared.\n");
      return 0;
  }

Gnu C can recognise "\x1B" as a way of encoding the character with
charactercode 0x1B (27, the escape character, here used to produce an
ANSI/VT100 sequence to clear the screen) into the string. Numerous other
compilers (esp. in the Dos/Windows world) also do. Dec C won�t, and the
problem is that Dec C does not even give a warning, so programs that use it
may fail very subtly at run time. The way to code the above sequence on Dec C
is to use octal notation, "\033", or to use %c and give the desired number as
argument.

Regards,
Tobias.







  reply	other threads:[~1999-06-13  4:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-09  4:00 Dec C pecularity Bernhard Reiter
1999-06-11  4:00 ` Jeff Sullivan
1999-06-13  4:00   ` Tobias Ernst [this message]
1999-06-14  4:00     ` Peter da Silva
1999-06-26  4:00       ` Tobias Ernst
1999-06-29  4:00         ` Charles M Richmond
1999-07-13  4:00           ` Tobias Ernst
1999-07-13  4:00             ` Kevin Oberman
1999-07-13  4:00             ` Charles M Richmond
1999-07-14  4:00             ` T.E.Dickey
1999-07-15  4:00               ` libcurses and patches for 4.0 jhitchcock
1999-07-16  4:00                 ` T.E.Dickey
1999-08-10  4:00                 ` b_andreasen
1999-07-16  4:00               ` Dec C pecularity Tobias Ernst
1999-07-18  4:00                 ` T.E.Dickey
1999-07-14  4:00         ` T.E.Dickey
1999-06-22  4:00     ` Jeff Sullivan
1999-06-22  4:00       ` Jeff Sullivan
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox