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

C programming tricks

Name: Anonymous 2007-09-15 22:06 ID:WCtjqT0N

While programming optimization that makes ones' code completely unreadable is often a bad thing, there are places for it, like that one inner loop of your code that takes up 98% of the program's running time.

What are you tricks for improving performance in C, other than the obvious inline assembly or the like?

Name: Anonymous 2008-02-07 17:11

optimized code

#include <stdio.h>

#define LEFT_CURLY_BRACE {
#define RIGHT_CURLY_BRACE }
#define LEFT_PARENTHESIS (
#define RIGHT_PARENTHESIS )
#define EOL ;
#define INTEGER int
#define CHARACTER char
#define NOTHING void
#define ECHO printf
#define TERMINATE exit

INTEGER main LEFT_PARENTHESIS NOTHING RIGHT_PARENTHESIS LEFT_CURLY_BRACE
        ECHO LEFT_PARENTHESIS "hello nigra!\n" RIGHT_PARENTHESIS EOL
        TERMINATE LEFT_PARENTHESIS 0 RIGHT_PARENTHESIS EOL
RIGHT_CURLY_BRACE

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