Re: little games
Christopher Benson-Manica said:
In comp.lang.c blangela <Bob_Langelaan@telus.net> wrote:
Consider using the Allegro gaming library for your course. The
gaming library code is written in C and can therefore be used in both
C and C+ + courses.
Not all C code can or should be used in a C++ course.
Nevertheless, the fact that Allegro has C bindings means that it can be
used as a "black box" library as part of a C++ course. Okay, it's not
exactly strictly conforming portable code, but it exists in (at least)
Win32 and Linux flavours, so there is a reasonable nod towards
cross-platformity.
The following
C program illustrates the point nicely:
#include <stdlib.h>
int main(void) {
char *new = malloc( 10 );
free( new );
return 0;
}
There are at least two features of this program that a C++ compiler
will choke on.
Irrelevant, since nobody is suggesting compiling Allegro with a C++
compiler. What matters is that it has C bindings, so it can be *linked*
into either a C program or a C++ program.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.