+ 1

Hi guys I just start programming and I want to ask if one of you can explane me the function "void"

8th Feb 2017, 6:00 AM
Ike Molokwu
Ike Molokwu - avatar
5 Answers
+ 2
It is a datatype,which does not written anything.Generally we pass void to main function i.e int main(void)
8th Feb 2017, 6:17 AM
Aditya Magare
Aditya Magare - avatar
+ 1
It is a data type that does not return anything.
8th Feb 2017, 6:01 AM
WALL_BUILDER
WALL_BUILDER - avatar
+ 1
thanks
8th Feb 2017, 6:02 AM
Ike Molokwu
Ike Molokwu - avatar
+ 1
thanks
8th Feb 2017, 6:21 AM
Ike Molokwu
Ike Molokwu - avatar
0
Hi void is not any function. It is not even considered as data type. When you want your function to return nothing then use return type "void". void sum(int a , int b) { int c = a + b; } the above function will calculate the sum but will not return anything since return type is mentioned as "void". Similarly you can declare a function taking nothing as follows void sum(void) { }
8th Feb 2017, 6:49 AM
Nikhil Shirke
Nikhil Shirke - avatar