need to know difference

0 Deepak Panday · September 27, 2015
can anyone please tell me the difference between  void main() , int main() and main()
 i am learning c ....i know why these 3 used...but i don't know the differnce between thm...can some please clarify this to me..

Post a Reply


Oldest  Newest  Rating
0 Franz Schmidt · September 27, 2015
main() is a function like any other one you can make on your own (hope you allready learned about functions).

and the word before the main() is the return type of this function.
int means the return value of this function is supposed to be a integer number.
void means there is no return value 

But I don't think it's possible to have no return spezification.
0 Tatrasiel R · September 27, 2015
Franz is right.

something kind of neat is that in the old days was that old programs were expected to return some integer for success or failure.

void doesn't return anything and was added in later.  in reality main is just another function and per convention will have everything tied together in this function.
0 Deepak Panday · September 28, 2015
thx..for telling me
  • 1



One of the most popular languages of all time.

Bucky Roberts Administrator