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-01-08 9:03

>>100
6. Compilers often give more memory to arrays than you asked for. Here's how to check how big an array actually is (memset returns a null pointer if the size you passed to it is bigger than the size of the array you passed to it):
O HI I UPGRADED UR ALGORITHM!
#include <stdlib.h>
#include <stdio.h>
char* main() {
  char* DATA = malloc(4097);
  printf("%u\n", *(unsigned int*)(DATA - 4));
  return DATA; /* ONLY PUSSEYS FREE THERE MEMORT; LET THE DOS DO IT!!! */
}

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