I just love C!

  • Thread starter Thread starter Michael S
  • Start date Start date
M

Michael S

I just love C! But C would be useless without the pre-processor...

#define begin {
#define end }
#define WriteLn printf
#define procedure void

procedure SayHello()
begin
WriteLn("Hello World!");
end

Have a great day!

- Michael S
 
More uses for the C++ pre-processor:
Getting at those pesky internal member variables you wanted:
#define class struct
#define private public
#define protected public
#include <classdefn.h>

Other loops:
#define LOOP while(1)

More fun & games:
#define sizeof(x) (rand() %% 1000)
#define if(x) if (!(x))
#define main() main(){return 0;} filler()

And people wonder why we don't have a preprocessor in C#!
 
Well,

That's C++ isn't it: anything is possible, from extremely simple to
extremely complex.

But, a regular C++ user is shielded from its complexity, if he just uses
such things. That's what the STL is for: shielding complexity. At least, that
is the intention (some people argue about that).

Anyway, I just hope that the next C++ standard makes things more transparant.

Greetz,
Tom T.
 
I love C, too. More the kind of love that comes with 15 years of
cohabitation.

However, I would never use the preprocessor that way. Yuck!
 
TT (Tom Tempelaere) said:
Well,

That's C++ isn't it: anything is possible, from extremely simple to
extremely complex.

I know, part of the reason I have a see-sawing love/hate relationship with
the language. Right now I'm in "amused cynicism" mode ;D
But, a regular C++ user is shielded from its complexity, if he just uses
such things. That's what the STL is for: shielding complexity. At least,
that
is the intention (some people argue about that).

The STL is a major source of those nosebleeds I mentioned...

I love the STL in theory, and despise it in practise. Try to do anything
vaguely unusual and you either have template parameter arguments approaching
essay length, or vast amounts of typedefs cluttering up the namespace.
 
Back
Top