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

My first C program

Name: Anonymous 2014-05-17 2:44

#include <stdio.h>

void f() { printf("hello, world\n"); }

char prog[6];
typedef void (*callable)();

int main() {
prog[0] = 0xe8;
*(int *)(prog+1) = ((char *)f)-((char *)(prog+5));
prog[5] = 0xc3;
((callable)prog)();
}


I wrote this last night after finishing K&R. How is it?

Name: Anonymous 2014-05-17 3:27

assigning an address to int
architecture dependent implementation

terrible!

Name: Anonymous 2014-05-17 4:03

>>20
The rich take advantage of the poor until the poor revolt and the rich find their heads under guillotines. A parasite that is eliminated by a collective action of their numerous hosts is not one fit for survival. Well adapted parasites are difficult to remove, like worms in the intestines of animals, or ticks on the hides of animals that don't have the dexterity to remove them.

Name: >>3 2014-05-17 4:05

wrong thread. I'm deeply embarrassed. So much so I will never post this shit on /prog/ again. Please hide your eyes from >>3.

Name: Anonymous 2014-05-17 9:26

your code is unportable and horrible, if L. A. was alive he would be deeply disapointed

Name: Anonymous 2014-05-17 9:35

>>2
Whom are you quoting?

Name: Anonymous 2014-05-17 9:38

>>6
your mom

Name: SEGA 2014-05-17 9:46

>>1
WHAT THE FUDDER

Name: Anonymous 2014-05-17 11:20

my other cdr is my mother

Name: Anonymous 2014-05-17 11:21

cudder

Name: Anonymous 2014-05-17 19:33

>>1
How is it?
32-bits are obsolete.

Name: Anonymous 2015-07-25 2:48

Didn't work on my SiCortex.

Name: Anonymous 2015-07-25 3:45

>>5
How did he die?

Name: Anonymous 2015-07-25 5:49

>>13
Everyone stopped reading DA STANDARD

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