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

Pages: 1-

C++ pointers

Name: Anonymous 2010-08-13 4:22

Hello /prog/ i normally program in java but i'm slowly moving to C++. Now on the topic of pointers can anyone give me some details?

Name: Anonymous 2010-08-13 4:30

Name: Anonymous 2010-08-13 4:38

It's just a slang term for the ^ operator (exponent) because it looks "pointy."  C++ supports it and Java doesn't.  No biggie.

Name: Anonymous 2010-08-13 4:45

C'mon guys, all I want is some pointers.

Name: Anonymous 2010-08-13 4:51

guys is it worth it to make 3D arrays in C++/C or should i just make a 1D array and pack it with all of the information and then use an indexer to find the information @ xyz?

Name: Anonymous 2010-08-13 4:53

>>5
Use a hashtable (std::map). They have guaranteed O(1) access and so they're very fast.

Name: Anonymous 2010-08-13 5:20

A pointer is just a address, you can dereference it and reference the value at that address.
The value has a type and so the pointer must be the same type(if you want the same value, you can for example get the char portion of and int var).

Name: Anonymous 2010-08-13 6:53

>>6
Not nearly as fast as a 3 dimensional array backed by a simple vector. However, even if hashtables are overkill for this, they're not that much worse than 3D arrays. It really depends on what kind of array it is and what you want to use it for.

Name: Anonymous 2010-08-13 7:31

amortized O(1) access

Name: ​​​​​​​​​​ 2010-10-26 14:44


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