r/ProgrammerHumor • • Feb 23 '14

punny stack overflow response

http://imgur.com/UbYvn6z
263 Upvotes

15 comments sorted by

12

u/Galaxymac Feb 24 '14

6

u/xkcd_transcriber Feb 24 '14

Image

Title: Pointers

Title-text: Every computer, at the unreachable memory address 0x-1, stores a secret. I found it, and it is that all humans ar-- SEGMENTATION FAULT.

Comic Explanation

Stats: This comic has been referenced 6 time(s), representing 0.0555% of referenced xkcds.


Questions/Problems | Website | StopReplying

7

u/[deleted] Feb 24 '14

I don't get this pointer joke, can you explain de reference?

3

u/[deleted] Feb 25 '14

I can point you in the right direction, in Objective C (what I assume this is) you need a * as a pointer when defining a variable. Example: NSString *helloThere = @"Hey!";

3

u/jaavaaguru Mar 06 '14

can you explain de-reference

Whoosh moment.

-5

u/TimLim Feb 24 '14

I thought it was a joke about Jews and Nazis :(

0

u/[deleted] Feb 23 '14

[deleted]

18

u/AsidK Feb 23 '14

Yes, in most C based or similar languages, when you put a * after a type it makes it a pointer

0

u/MarekRules Feb 24 '14

I sure do hate pointers.

5

u/AsidK Feb 24 '14

What is your language of choice?

5

u/[deleted] Feb 24 '14

ASM.

1

u/MarekRules Feb 24 '14

shudder I'll stick to my C# and Javascript. I still have nightmares from Operating Systems class and using pointers to pointers, and later arrays of pointers. For some reason in C, they just confuse the shit out of me.

3

u/tuseroni Feb 24 '14

pointers are great when you get used to them, until then it's just putting in combinations of "*" and "&" until it fucking compiles.

2

u/MarekRules Feb 24 '14

That's exactly what I tell people learning JavaScript and JQuery. "Just use a combination of $ signs until it doesn't blow up and then debug line by line from there."

2

u/kqr Feb 24 '14

Low-level languages have the concept of a pointer, which is a variable that do not contain the value you want – it contains the memory address of the value you want. So instead of being like a box with the letter C in it, it is a box with a piece of paper that says in which box you can find the letter C.

The concept of a pointer (or a reference or an access type, roughly the same thing but different names) is useful in languages which have no automatic memory management, because such languages may require you to manually keep track of in which memory addresses you have stored stuff.

In popular low-level languages such as C, saying char i gives you a variable that can store a character, and saying char *i gives you a pointer that can contain an address to a memory location where a character is stored.