Using arrays of function pointers to emulate prototype-style OOP with structures.
Name:
Anonymous2008-02-17 13:48
They're mostly good for making jokes about "giving you a few pointers.", but they're also a crucial ingredient in the renowned Null Pointer Exception.
Name:
Anonymous2008-02-17 14:13
The pointer is essential to solving any programming problem. A pointer allows you to abstract some of your information. In most programming assignments one doesn't only use int, float, or any other primitive data types. They are called primitive data types because they only use 32 bits or less depending on your architecture. Most programs use abstractions to represent a single idea. For example, lets say I wanted to create a computer game with a person in it. In C I could create a struct with all the information a person would have (e.g. hair color, height, etc.). In C++ and Java I would create a class to represent the human. Pointers/references only store an address that points to the abstraction that was created, in our case a human. This allows easier manipulation of the "human" variable by enabling the programmer to pass a 32-bit address instead of megabytes of information to different functions of the same program.
In the long run pointers will save you a lot of memory space and other goodies mentioned above.
Good luck.
Name:
Anonymous2008-02-17 15:00
When all you have is a dereference operator -- everything is a pointer.
Name:
Anonymous2008-02-17 16:58
>>15
No it's not. The Turing machine does not use pointers, and can compute anything.
I kind of understand pointers, but what about arrows?
Name:
Anonymous2008-02-19 15:29
>>42 lolFun :: (Bool -> [Char]) -> Char
means that the function takes a predicate (Bool) and a list of Chars, then the predicate is applied to the list and returns a single Char.
>>61
Maybe it isn't JPEG artifacts, but that noise is actually part of the font?
Name:
Anonymous2008-02-19 20:56
>>63
Hey /prog/, let's make a monospace bitmap version of Comic Sans, suitable for coding. The best of both worlds.
Name:
Anonymous2008-02-19 21:08
>>61 >>54 here, and I'm proud to announce that I have successfully trolled you.
Name:
Anonymous2008-02-19 21:19
>>66 >>61 here, and I'm proud to announce that I have successfully trolled you.
Name:
Anonymous2008-02-19 21:33
>>67
This may surprise you, but I invented the ``>>61 here, and I'm proud to announce that I have successfully trolled you.'' meme.
Name:
Anonymous2008-02-19 21:41
>>68
This may surprise you, but I invented the ``This may surprise you, but I invented the x meme'' meme.
Name:
Anonymous2008-02-19 22:57
>>69
This may surprise you, but I invented English.
Name:
Anonymous2008-02-19 23:11
Pointers let you in effect pass a small object (i.e., the pointer to a big object) instead of copying a big, full object. Pointers are also useful when you want a function to modify something outside of itself.
Name:
Anonymous2008-02-19 23:16
>>70
This may surprise you, but I invented language.
Name:
Anonymous2008-02-19 23:37
>>72
This may surprise you, but I invented humans.