answersLogoWhite

0


Best Answer

If a method call is void, that means it will not return a data value to a program that calls it. Otherwise, the method is expected to return a data value of some sort.

For example, if I have a method called print() that is void, and the body of the method has a command to print a word to the screen, the method will run that command and end.

However, if I have a method called add(int x, int y) that takes two numbers and adds them together, the program calling this method wants an answer back. So this method is not void.

User Avatar

Wiki User

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

Wiki User

12y ago

functions declared as void data type return nothing, whereas non void datatype returns some value

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference of non void and void function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the Difference between virtual methods and non virtual methods in c sharp?

A function is a method that returns a value other than void. Methods includes functions, subroutines, constructors, destructors, and properties.


What is homogeneous and non homogeneous production function?

difference between homogeneous and non homogeneous production function


How do you Write a function prototype for a function named printStars that accepts no arguments and returns no data?

void printStarts (void);


A c program to call a function without using function name?

It can be done via its address, for example: void function (void (*callback)(void)) { (*callback)(); }


Difference between linear consumption function and non linear consumption function?

I have no idea. However, in theory there is a difference.


Is void a data type in c?

what is void data type Void is an empty data type normally used as a return type in C/C++, C#, Java functions/methods to declare that no value will be return by the function. The another use of void is to declare the pointer in C/C++ whe It is not sure that what data type will be addressed by the pointer. eg: void *p; Here p can hold the address of int or float or char or long int or double.


Why you are using VOID in C programming?

You don't use 'VOID', but 'void'. It means different things, such as:- void as function type means no return value- void as function parameter means no parameters- 'void *' as pointer-types means generic pointer


Why void is used in c language?

void as function return-type means no return value void as function parameter means no parameter void * as pointer type means generic pointer


What is the purpose of the keyword void in a function declaration?

when we declare any function with void,it doesnt return any value


What are the minimum requirements for defining a function?

here is an example of a minimal function, I hope this helps: void foo (void) {}


What is a Generic Function in c plus plus?

Predefined functions are built-in functions that perform standard operations and that generally do not depend on any classes. A predefined void function is simply a predefined function that has no return value. An example of a predefined void function is the abort() function which typically has the following signature: void abort(void);


What is the difference between program and programing?

the program contains the which are coding like as our header file ,void main,library function etc.