0

I can't understand what is the difference of void type data type to the other data types, can anyone explain what is the use of void data type to a program

26th Aug 2016, 12:01 AM
Joshua Mariscotes
2 Answers
+ 1
Void is not a data type. It basically means "empty". It is used to indicate a function won't take any parameter or return anything. void MyFunc(int a) is a function returning nothing. int MyFunc2(void) is a function accepting no parameter. int MyFunc3() is a function accepting as many parameters as you want. Most people writing this actually mean that it doesn't take any parameter and should have written it with void, like in MyFunc2.
26th Aug 2016, 8:17 AM
Zen
Zen - avatar