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

Pages: 1-

Three star programming

Name: Anonymous 2015-07-07 1:58

Hey guys, I found this gem in Reddit. This code will reverse an array in place with pointers.
http://www.reddit.com/r/programming/comments/cihh7/three_star_programmer/c0sug3o

#include <stdio.h>

void reverse(int ****, size_t);
void swap(int ****, int ****);

int main() {
int arr[]={1, 2, 3, 4};
int *p = arr;
int **pp = &p;
int ***ppp = &pp;
int ****pppp = &ppp;

reverse(pppp, 4);

for (int i = 0; i < 4; i++) {
printf("%d\n", *(***pppp + i));
}
}

void reverse(int ****pppp, size_t size) {
int *s = ***pppp;
int **ps = &s;
int ***pps = &ps;
int ****ppps = &pps;

int *e = (***pppp + size - 1);
int **pe = &e;
int ***ppe = &pe;
int ****pppe = &ppe;

while (***ppps < ***pppe) {
swap(ppps, pppe);
(***ppps)++;
(***pppe)--;
}
}

inline void swap(int ****x, int ****y) {
const int temp = ****x;
****x = ****y;
****y = temp;
}

Name: Anonymous 2015-07-07 3:58

I found this gem in Reddit.
KEEP IT THERE

Name: Anonymous 2015-07-07 5:29

>>2
rude

Name: sage 2015-07-07 10:37

I was about to go get some food, but after reading that I'm .... not sure I can eat again.

that fake disgust

makes me cringe

Name: Cudder !cXCudderUE 2015-07-07 13:13

It doesn't count unless you actually use all those indirection levels.

Name: Anonymous 2015-07-07 18:33

Turns out ``three star programming'' is an epic C2 meme. Nice, +1, upvote. Relevant XKCD ;)

Name: Anonymous 2015-07-07 18:59

>>6
I don't know what that means.

Name: Anonymous 2015-07-07 19:41

Name: Anonymous 2015-07-07 20:05

>>7
http://c2.com/cgi-bin/wiki?ThreeStarProgrammer
The most epic coding meme database on the Internet.

Name: Anonymous 2015-07-08 2:08

Wow, an actual thread about programming and you guys just sage down all the way. Stay the same guys, never change.

Name: Anonymous 2015-07-08 2:20

it's a shit thread, just some garbage reddit post about some idiot pointer to pointer to pointer meme

Name: Anonymous 2015-07-08 23:41

This is the C coder's version of the FactoryFactoryFactory meme.

Name: Anonymous 2015-07-09 1:19

>>10
This thread is about programming in the same way Discovery Channel and that I Fucking Love Science page are about science.

>>12
Please don't use the word ``coder'' so lightly.

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