+ 1

I do not really get "void".

22nd Oct 2017, 12:36 PM
Cheerio Bob
Cheerio Bob - avatar
5 Respuestas
+ 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
22nd Oct 2017, 3:24 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 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.
22nd Oct 2017, 3:17 PM
D_Stark
D_Stark - avatar
+ 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
22nd Oct 2017, 1:08 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 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.
22nd Oct 2017, 12:44 PM
ghostwalker13
ghostwalker13 - avatar
+ 2
No return from the void lol
23rd Oct 2017, 2:45 AM
Pickle_Rick()
Pickle_Rick() - avatar