+ 2
Under which kind of data structure do a pointer fall.
linear non linear primitive non primitive
3 odpowiedzi
+ 1
a) Primitive
From Wikipedia: "A memory pointer (or just pointer) is a primitive, the value of which is intended to be used as a memory address."
0
I'm new to C++ so I might have some of the semantics wrong, but I'm pretty sure pointers are technically "compound types" and they're usually represented as a long long. The exact definition depends on the architecture the code is compiled for, but it probably would be a 48-bit integer on a 'modern' x86-64 machine.
I also don't think they're linear nor non-linear because they're not iterable.
0
I would like to get some clarification on this. Would an int or char be considered a primitive and any type created by combining two or more primitives be a non-primative? If so then a pointer would be a non-primative since it is built by combining ints.