+ 2

Under which kind of data structure do a pointer fall.

linear non linear primitive non primitive

12th Apr 2017, 8:34 AM
GeekyShacklebolt
GeekyShacklebolt - avatar
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."
9th Aug 2020, 6:26 PM
Sagi
Sagi - avatar
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.
12th Apr 2017, 12:35 PM
Jesse Wyatt
Jesse Wyatt - avatar
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.
4th Nov 2018, 5:24 PM
Roger Greenlaw