Re: Simplicity has a future



Marc Boyer said:

Le 31-05-2006, Richard Heathfield <invalid@xxxxxxxxxxxxxxx> a écrit :

[Any] C programmer having trouble understanding the code would probably
have trouble understanding "Winnie the Pooh".

What is your definition of "C programmer" ?

Someone who understands C.

When did you met C beginner last time ?

Have you read this newsgroup recently?

My C++ solution, however, is even simpler!

extern "C" {
#include "my_c_solution's_header.h"
};

and linking in <insert library name here>.

So C++ is simpler than C: that is what I wanted to illustrate ;-)

If you say so. But C is simpler than C++, *next* time, because *next* time I
need to use such a function, I can do this:

#include "my_c_solution's_header.h"

and link in the appropriate library, without bothering with all that extern
"C" nonsense. We call it "code re-use", and I recommend it to you.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages

  • Re: Simplicity has a future
    ... What is your definition of "C programmer"? ... All the C99 standard? ... and link in the appropriate library, without bothering with all that extern ... the complexity of the problems. ...
    (comp.lang.c)
  • =?iso-8859-1?Q?Re:_Firmen-Richtlinien_f=FCr_ausgehende_Mails_pr=FCfen?=
    ... Ist sie extern muss eine Warnung kommen das "n externe Adressen gefunden wurden und wollen sie wirklich senden?". ... Bitte nur in die Newsgroup antworten. ... Microsoft Exchange Server Newsgroup ...
    (microsoft.public.de.german.exchange2000.general)
  • Re: Mail-enabled Groups
    ... wenn von extern das nicht nach intern geleitet wird ist sie natürlich auch von extern nicht erreichbar ... Bitte nur in die Newsgroup antworten. ... Microsoft Exchange Server Newsgroup ...
    (microsoft.public.de.exchange)
  • Re: ifdefs
    ... a C++ newsgroup, not a C newsgroup, but as a quick summary: ... "extern C" modifier means that the function names will not be ...
    (comp.lang.c)
  • Re: keyword extern
    ... declare a variable in head1.h as int i and define it in file1.c ... multiple times using extern in all the files file2.c ... ... the significance of "extern"ing is lost. ... The programmer could have ...
    (comp.lang.c)