answersLogoWhite

0

What does of size of operator do?

Updated: 12/15/2022
User Avatar

Wiki User

13y ago

Best Answer

The sizeof() operator returns the number of bytes allocated to the operand.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does of size of operator do?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you find size of any object in java OR is there any operator or fun.. equivalent size of in c plus plus?

No, there is no such operator or function in Java that can tell you the amount of memory an object uses.


What is the return value when new operator is not able to allocate memory in c?

There is no operator new in C.In C++11, there are three versions of operator new, all of which can be overridden. Default behaviour is as follows:(1) throwing allocationvoid* operator new (std::size_t size);If an allocation of the given size cannot be met, an exception will be thrown. There is no return value after an exception is thrown.(2) nothrow allocationvoid* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;If an allocation of the given size cannot be met, nullptr is returned.(3) placementvoid* operator new (std::size_t size, void* ptr) noexcept;Always returns ptr. You use this version when memory has already been allocated and you are merely providing placement for an object within that allocation.


How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).


A water operator or an water operator?

A


How do you find largest of two object using operator overloading in c?

I will not use operator overloading in C# to do anything. Operator overloading may lead to one operator has more than 1 semantic meaning. For example, we know 1 + 2 yields 3, and "1" + 2 yields "12". I do not like this overloading of the operator + being used for addition in Number hierarchy, while as the concatenation in strings. That is, one operator (+) has 2 significant semantics.And the question "find largest of two object" is too vague - what do you mean "largest"? and object? We know apple and orange are 2 objects, but how do you compare them, and find the largest one?????? (size, price or what???)

Related questions

What is the operator that cannot be overloaded in c plus plus and java?

conditional operator , size of operator , membership operator and scope resulation operator can not be overload in c++


Size of operator?

The sizeof() operator returns the number of bytes required to represent its argument.


How do you find size of any object in java OR is there any operator or fun.. equivalent size of in c plus plus?

No, there is no such operator or function in Java that can tell you the amount of memory an object uses.


Which is dummy operator in c?

In C, the sizeof operator can be considered a dummy operator because it does not perform any operations on the data but simply returns the size in bytes of a variable or a data type.


What is the return value when new operator is not able to allocate memory in c?

There is no operator new in C.In C++11, there are three versions of operator new, all of which can be overridden. Default behaviour is as follows:(1) throwing allocationvoid* operator new (std::size_t size);If an allocation of the given size cannot be met, an exception will be thrown. There is no return value after an exception is thrown.(2) nothrow allocationvoid* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;If an allocation of the given size cannot be met, nullptr is returned.(3) placementvoid* operator new (std::size_t size, void* ptr) noexcept;Always returns ptr. You use this version when memory has already been allocated and you are merely providing placement for an object within that allocation.


What is the use of 'size of' in c programming?

The sizeof operator is used to determine the length of its operand (in bytes). The operand must be a type or an object of a type (a variable). The operator is a constant expression and therefore executes at compile time. As such there is no runtime overhead in repeated use of the sizeof operator.


What are different types of operators?

The different types of operators are as follows: *Arithmatic operator *Relational operator *Logical operator *Assignment operator *Increment/Decrement operator *Conditional operator *Bitwise operator *Special operator


How size-of variable is used in c?

The Sizeof () operator only works at compile time and doesn't evaluate anything at run time.


Which operator works like sizeof operator in Java?

Java does not have the sizeOf() operator or any operator that gives an equivalent result.


What is operator function?

An operator function implements a particular operator symbol. The database server provides special SQL-invoked functions, called operator functions, that implement operators. An operator function processes one to three arguments and returns a value. When an SQL statement contains an operator, the database server automatically invokes the associated operator function. The association between an operator and an operator function is called operator binding. You can overload an operator function to provide the operator for a UDT. The SQL user can then use the operator with the UDT as well as with the built-in data types. When an SQL statement contains an operator, the database server automatically invokes the associated operator function.


Is a water operator or an water operator which is correct?

A water operator is grammatically correct.


How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).