Wednesday, January 4, 2012

What does void main(void) mean?

What does void main(void) mean?

This line gives the name of the function that we have written and information about what goes into and out of the function. In this case, the name of the function is main.

C not only allows you to use library functions, it allows you to write your own functions. Normally, your first programming assignment will be to write the main function. Every C program has a primary function that must be a assigned the name main. The name main is mandatory and cannot be altered by you, the programmer. In other words, even if your program had the purpose of printing your address to the screen you could not name the primary function printmyaddress and have the line be void printmyaddress(void). The function must be called main.

No comments:

Post a Comment