Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[style] one-line functions in C

Name: Anonymous 2010-04-11 13:03


int frozen(int arg)
{
  return (arg+23);
}


OR


int frozen(int arg)
{ return (arg+23); }

int frozen(int arg)
  { return (arg+23); }


OR MAYBE EVEN SCREEN ESTATE SAVING


int frozen(int arg) { return (arg+23); }


The first version would be consistent myth my usual style, but version 2.2 looks too sweet to resist.

Name: Anonymous 2010-04-11 15:24

>>19
You need more #defines

#define RETURNING
#define FUNCTION
#define TAKES (
#define AND ,
#define AS
#define INPUT )
#define BEGIN {
#define END }
#define NOW
#define SUM +

RETURNING   int
FUNCTION    sum
TAKES       int a
AND         int b
AS INPUT
BEGIN
        return TAKES a SUM b AS INPUT NOW
END

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List