Can someone please give an example using void?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone please give an example using void??

24th Mar 2020, 3:50 PM
100 subs with 2 videos
100 subs with 2 videos - avatar
3 Answers
+ 6
Void means nothing is returned back to were you called the function in your code. Theres one function that returns something and there one function which is void and returns nothing. Both types of functions can take in arguments when called but non void function will return a result, a void function returns nothing. You should create 2 functions and test them by calling each in your code.
24th Mar 2020, 4:24 PM
D_Stark
D_Stark - avatar
+ 1
Void defines a function which doesn't return a value.
24th Mar 2020, 4:39 PM
Jannik Müller
Jannik Müller - avatar
0
ok so does void display any output?(cpp)
26th Mar 2020, 3:12 PM
100 subs with 2 videos
100 subs with 2 videos - avatar