A value is anything that may be evaluated, stored, incorporated in a data structure or object, passed as an argument, returned, etc. For examples, what kinds of values exist in C++?
What is a type?
{..., -1, 0, 1, ...}
boolean = {false, true}
integer = {..., -1, 0, 1, ...}
float = {..., -1.0, ..., 0.0, ..., 1.0, ...}
character = {'\0', ..., 'a', ..., 'z', ..., '\255'}
enumerated = {jan, feb, ..., dec}
such as from a Pascal type definition like `type month = (jan, ...,
dec);'
subrange = {28, 29, 30, 31}
such as from a Pascal definition like `var day : integer[28..31];'
#boolean = 2
#integer = MAXINT - MININT (in Pascal)
#character = 255
#{jan, feb, ..., dec} = 12
#{28, 29, 30, 31} = 4
These are basic types, often supported at the `hardware' level.
10101101 a byte
00101011 another byte
--------
10101111 result of logical-or
10101101 a byte
00101011 another byte
--------
00101001 result of logical-and
Copyright © 1998. Alan McCabe. All rights reserved.