Can a variable like 'int' be considered a primitive/fundamental data structure?
Posted
by Ravi Gupta
on Stack Overflow
See other posts from Stack Overflow
or by Ravi Gupta
Published on 2010-01-12T05:02:39Z
Indexed on
2010/04/04
16:23 UTC
Read the original article
Hit count: 167
A rough definition of a data structure is that it allows you to store data and apply a set of operations on that data while preserving consistency of data before and after the operation. However some people insist that a primitive variable like 'int' can also be considered as a data structure. I get that part where it allows you to store data but I guess the operation part is missing. Primitive variables don't have operations attached to them. So I feel that unless you have a set of operations defined and attached to it you cannot call it a data structure. 'int' doesn't have any operation attached to it, it can be operated upon with a set of generic operators.
Please advise if I got something wrong here.
© Stack Overflow or respective owner