Sizeof in the context of Operator (computer programming)


Sizeof in the context of Operator (computer programming)

Sizeof Study page number 1 of 1

Play TriviaQuestions Online!

or

Skip to study material about Sizeof in the context of "Operator (computer programming)"


⭐ Core Definition: Sizeof

sizeof is a unary operator in the C and C++ programming languages that evaluates to the storage size of an expression or a data type, measured in units sized as char. Consequently, the expression sizeof(char) evaluates to 1. The number of bits of type char is specified by the preprocessor macro CHAR_BIT, defined in the standard include file <limits.h>. On most modern computing platforms this is eight bits. The result of sizeof is an unsigned integer that is usually typed as size_t.

The operator accepts a single operand which is either a data type expressed as a cast – the name of a data type enclosed in parentheses – or a non-type expression for which parentheses are not required.

↓ Menu
HINT:

👉 Sizeof in the context of Operator (computer programming)

In computer programming, an operator is a programming language construct that provides functionality that may not be possible to define as a user-defined function (i.e. sizeof in C) or has syntax different than a function (i.e. infix addition as in a+b). Like other programming language concepts, operator has a generally accepted, although debatable meaning among practitioners while at the same time each language gives it specific meaning in that context, and therefore the meaning varies by individual language.

Some operators are represented with symbols – characters typically not allowed for a function identifier – to allow for presentation that is more familiar looking than typical function syntax. For example, a function that tests for greater-than could be named gt, but many languages provide an infix symbolic operator so that code looks more familiar. For example, this:

↓ Explore More Topics
In this Dossier