Search code examples
c#computer-scienceabstract-data-type

What is an individual instance of a data type called?


This is just out of my own curiosity; I was looking for the right word while asking a question in a discussion today. I don't have a computer science background.

Is there a proper word for any given instance of a partition of a particular data type?

Is it simply value? Index? Say I'm talking about a byte in C#, which can take an unsigned integer primitive value of 0 to 255. Conceptually, I am thinking that there are 256 "boxes" that are filled by these "values," and I am looking for the word that refers to the "box," if there is one.


Solution

  • This is called state. Talking about every possible state you're looking for the term state space.

    An 8-bit byte has 256 possible states because there are two possible states per bit so you have 2^8 states. A C-style struct with two boolean members can have four states or 2^2. Two bytes and you're looking at 256^256 states. State space gets big fast.