In computing and programming, a scalar variable or value refers to a single value, as opposed to data structures such as arrays or lists.
In computing and programming, a scalar variable refers to a single value, as opposed to data structures such as arrays or lists. A scalar can be of any type, including a complex type such as an object or string. Being scalar only means that it is manipulated as a single value.
As an example, the string type in C++ is considered to be a scalar as it is a primitive type containing a single value, although in the C language there is no such primitive type. Thus, the char array implementation of strings typically used would not be considered as a scalar.
See also: