[Coco] C vs. C

Joel Ewy jcewy at swbell.net
Mon Nov 20 22:21:08 EST 2006


Rod Barnhart wrote:
> While they both have their own specific idiosyncrasies, C is C. The
> biggest problem I have had in moving from Turbo C to GNU's gcc is in
> remembering if a function that I want to use is part of the standard
> library, or if it is Borland-specific. The basics are the same either
> way.
>
> Rod
>
>   
To be more specific, the C language itself is fairly small.  There are
logic and arithmetic operators, program control stuff, et cetera.  But
unlike BASIC, C doesn't have a built-in command to print, for instance. 
That is handled by library functions (like subroutines) that are
technically separate from the language proper.  So along with the C
compiler and its associated linkers and so forth, you have library
files.  There is a C Standard Library that includes functions like
printf() and scanf(), which are roughly equivalent to BASIC's PRINT and
INPUT statements.  While most of the functions from the standard library
should work the same or nearly the same between different versions of C,
they tend to diverge from there.  And there are libraries and libraries
of functions to do all kinds of system-dependent things, like graphics,
and GUI stuff, and I/O nitty-gritty, ad nauseum.  You can write simple
"hello world"-type programs that should compile on anything from OS-9's
C compiler on the CoCo to current versions of GCC (though even with such
simple programs you may have to do a little translation from K&R to ANSI
C (in any clean, uncluttered space in your program code, simply insert
"(void)" and you've ANSI-fied it :) (OK, not really...))).  But when you
start working with GUI widgets or device drivers you really need good
system-specific documentation.

JCE
> On 11/20/06, Leon Howell <puritan_2076 at yahoo.com> wrote:
>   
>> I have a few books on C and will soon attempt to learn something from them.
>> The trouble is, some of them are for Borland Turbo C or MS C. Are there any
>> differences I should know about before I cet hopelessly foncused?
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>>
>>     
>
>   




More information about the Coco mailing list