+ 1
I do not really get "void".
5 Réponses
+ 28
hey ,
when u just want to print something by using a method then u can use void in front of it , bcz u don't want it ro return a value ... u just want to print something
+ 6
like int retuns an integer value.
void returns nothing the method has no value.
if it has a print method attached this will output nevertheless as this has a return type to print to console.
+ 5
void is used as a return type for those function which actually returns no value
i.e.
void say(){
cout<<"Hello"; // In C++
}
See, no value is returning from say() function
+ 3
In the dictionary, "void" means: the absence of value or meaning. So if you said: "My life has been voided", you'd actually be saying: "My life means nothing", symbolism debatable.
Programming 'void functions' requires the use of "void", to make a function that does not expect a returning result.
Functions are dumb, languages are dumb, computers are dumb. If you don't explicitly specify what you want them to do, and in what order: they will wreck stuff.
Stay safe, and don't "void" your computer. Puns, funny they are.
+ 2
No return from the void lol