answersLogoWhite

0

Function with no argument and no return values?

Updated: 8/17/2019
User Avatar

Wiki User

12y ago

Best Answer

Are usable. Example:

void hello (void)

{

puts ("Hello");

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Are perfectly legal, for example:

void hello (void)
{
puts ("Hello");

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

void example (void)

{ puts ("Hello, I am an example"); }

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Function with no argument and no return values?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are limits in maths?

Limits (or limiting values) are values that a function may approach (but not actually reach) as the argument of the function approaches some given value. The function is usually not defined for that particular value of the argument.


An argument takes a value or values and performs an operation?

In programming, an argument takes a value or vales and performs an operation is called a function or method. If a method does not return a value, it is described as 'void'.


The set of all values that a function will return as outputs is called the of the function?

The set of all values that a function will return as outputs is called the *range* of the function.


Where do you use no argument no return in c function?

Where there is no need to return any type of value from a function


How can you find the domain and range of a function?

The domain is a subset of the values for which the function is defined. The range is the set of values that the function takes as the argument of the function takes all the values in the domain.


What are the domain and range of the function?

The domain of a function is the set of values for which the function is defined.The range is the set of possible results which you can get for the function.


What does sqrt function return?

square root of the argument


CAN Overloaded functions can return default values?

I'm not sure I understand you as it wouldn't make sense for a function to return a default value. Do you actually mean can a function return an argument that has a default value? If so, then yes. Any argument passed to a function, whether defaulted or not, can be returned by the same function. If the argument is passed by value then you must return it by value. If passed by reference (which cannot be defaulted) then you can either return by reference or by value. However, if you pass by non-constant reference then you can just use the reference as an output argument, and use the actual return value for some other purpose, such as reporting any error condition(s) created by the function. Overloaded functions are no different to ordinary functions, the only criteria is that each overload has an unique signature. The return value does not form any part of the signature, thus signatures cannot differ by return type alone.


Write a program to return a function using class in C Plus Plus?

Classes cannot return values, only functions can return values. But you cannot return a function from a function, you can only return a function pointer -- a pointer variable holding the address of the function you wish to return. All possible return values must be of the same type, therefore all function signatures and return types must be exactly the same -- only the name of the functions can differ.


Why function should return a value?

Not all functions return values. If you take a function which is of type void, you get a function which is does not return anything. The only functions which should return values are those which are used as a right side of expressions (so called rvalues).


What type of a variable is used to indirectly return multiple results by a function?

To return multiple values of the same type, return an array. If the values are different types, return a tuple or data structure. To return values indirectly, return a pointer to the results (arrays implicitly convert to pointers, but tuples and data structures do not). A returned pointer must never refer to a local variable of the returning function; upon return, those variables will cease to exist, resulting in undefined behaviour. To avoid this, the caller may provide a user-defined storage location via an output argument, or the function may allocate the return values on the free store (the heap).


How are functions invoked in cpp?

If the function is inline expanded then it is not invoked at all -- there is no function call. However, if the function is not or cannot be inline expanded, a procedure call is invoked. This pushes the calling function's local values onto the stack, followed by the return address, followed by the callee's argument values in reverse order. Control is then passed to the address of the function. The function then pops the arguments off the stack and assigns them to its local parameters (parameters that are passed by value will automatically invoke the copy constructors of those parameters). The function then executes. When a return statement is encountered, the return address is popped from the stack, the return value (if any) is pushed onto the stack, and control is passed to the return address. When a function returns, the return value (if any) and the local values are popped from the stack, and execution continues from where it left off.