answersLogoWhite

0

Binary and unary function in C plus plus?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

A binary function would be one with two parameters, a unary, one with one parameter.

However, these words are usually used for operators. For example, the common arithmetic operators, +, -, *, /, % are binary - they need two operands, for example, "2 + 3". The minus sign can also be unary; -x is the additive inverse of x. Unary means one operand is required. Boolean operators for and, or, xor, are binary. Actually, the great majority of operators are binary.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Binary and unary function in C plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is plus operator is it unary or binary?

There is no unary plus in C, but if there were, it would have only one operand, unlike the binary plus which has two: x = a + b; /* binary plus */ x = + b; /* unary plus -- not in C*/ x = a - b; /* unary plus */ x = - b; /* unary minus */


What is difference between binary and unary operator in c language?

The number of arguments will be one for the unary operators and two for the binary operators. In the case of unary operators, the argument must be of the same type as that of the enclosing class or structure.


How unary minus can be overload in c plus plus?

type operator- ();


What is the function of the number sign in c plus plus?

If I understand your question, the number sign for a value or number can represent either a positive quantity or a negative quantity when attached to a native data type.For other data types it can represent the opposite of, or can be an overloaded operator (either unary or binary) that can take on any representation you with the operator to have (which can include non-intuitive reasoning's).


Can C plus plus read binary?

yes it can very much so read binary.


What are the building function in c plus plus?

There is no such term as "building function" in C++.


What is operand in c plus plus?

An operand is the value that is being operated upon by an operator. For instance, the C++ increment operator (++) is a unary operator, which means it has only one operand, the variable that we wish to increment. This in the expression x++, x is the operand. The addition operator (+) is a binary operator and therefore has two operands. Thus in the expression x + y, x and y are the operands.


Operator original function in OOP C plus plus?

I'm not sure I fully understand the question. Operators and functions are not the same. However, many operators also have named alternatives implemented as functions, such that "add" is synonymous with the binary increment operator while "plus" is synonymous with the unary plus operator. However these are completely separate implementations that do the same thing such that the function implementation typically invokes the operator (with implicit inline expansion to factor away the unwanted function call). There is no way to determine the underlying function of an operator, nor the underlying operator of a function without having access to the implementation source code. Such implementation details cannot be accessed at compile time let alone runtime.


Example of binaray operator in c plus plus?

+ is an example, one of many, of a binary operator in C or C++ a = b + c; // for usage example


What is GCD in C Plus Plus?

A C++ implementation of the Binary GCD (Stern's) algorithm is shown in the Related Link below.


A c plus plus statement that invokes a function is known as?

...a function call.


When will you make a function inline in c plus plus?

yes,we can make function inline