TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: HERMAN SCHONFELD
from: KURT KUZBA
date: 1998-04-24 23:45:00
subject: cprintf() & standards

HS>   And it was mainly for the use of ansi-colours, was it
HS>   not? That is why the c standard doesn't allow printf() to
HS>   output colours
   Actually, that is exactly backwards. :)
   printf() lacks color and cursor control because those things
   do not necessarily exist on the device being programmed, and
   so are not necessary to a standard implementation.
   Heck... my toaster doesn't even have a printer, much less a
   random access type display such as a crt or led screen.
   ( NOTE: This is a theoretical toaster with an embedded
      controller programmed in C. My REAL toaster employs
      springs and levers and a variable mechanical timer,
      and is badly in need of replacement, having lost the
      ability to adequately eject toasted objects and not
      being configured, in hardware, for the acceptance of
      thicker comestibles, such as bagels. )
   cprintf() is a non-standard addition for platform specific
   compilers in which such things may be taken for granted.
   There is a sort of quasi-standard, or general consensus of
   the way things are done within the conio library, but nothing
   is guaranteed by the standard, and it does vary from compiler
   to compiler, sometimes enough to thoroughly vex a programmer
   attempting to change from, say, Turbo C, to MS C.
   The point is, that, beyond the standard, nothing is certain.
   Every compiler producer is at liberty to interpret their
   nonstandard functions in any way they find makes sense to
   them, and will best serve their customers. You can trace the
   logic of the various implementations easily enough, though
   it may give you a bit of a headache. 
   Wherever cross-platform development is an issue, or code is
   to be shared with users of other compilers or OS's, then an
   effort should be made to either adhere to the standard or
   wrap the nonstandard calls in a secondary function, wherein
   the person using the source code may find all the nonstandard
   function calls, along with comments on their use and purpose
   so that they may either replace them or provide their own
   code to produce the same intended results.
> ] Never ask for justice. Trust me... You won't like it........
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.