void is used by functions that do not return a value. For example:
// This function returns an integer, which you can use in other functions
int addTwoNumbers(int a, int b)
{
return(a + b);
}
// This function does not return a value, so we declare it as a void
void printSum(int a, int b)
{
cout << a << " + " << b << " = " << addTwoNumbers(a, b) << endl;
// Note that attempting to return a value here will cause an error.
}
It doesn't. Void has the same meaning in both.
There is no such thing as devoid in C++.
There is no such term in C++. You probably meant void datatype. Void simply means "no type" and is primarily used as a place-holder for functions that do not return a value, since all functions must return something even when they return nothing at all. Not to be confused with void* which is a pointer to any type which, if non-null, must be cast to the correct type before being dereferenced.
doesn't return the value.
println is not a C++ keyword.
void main() { int *x = malloc(sizeof(int) * 10); }
#include int main (void) { puts ("1 2 3"); }
Call by reference means calling a function using a reference to a variable or a pointer. You call a function by passing refrences to a variable. For eg: void x(int &a) { a=2; } void main() { int s=3; x(s); } OR void a(int &c) { c=5;}void main(){ int *p; *p=2a(*p);}
Example: int main (void) { LOOP: goto LOOP; }
void myfun (int *pi){if (i==NULL) printf ("check failed");}
int main (void) { puts ("Hello, world"); return 0; }
By returning a value. Or using type 'void'.