Another simple C program with void return value



Compiler: Visual C++ Express Edition 2005

Compiled on Platform: Windows XP Pro SP2

Header file: Standard

Additional library: none/default

Additional project setting: Set project to be compiled as C

Project -> your_project_name Properties -> Configuration Properties -> C/C++ -> Advanced -> Compiled As: Compiled as C Code (/TC)

To do: nothing

To show: The void return of main()




/* for printf(), scanf() & other standard i/o */

#include <stdio.h>


/* main() function with no argument and no return value */

void main(void)


printf("Testing 1...2...3...\n");

printf("Hello dude!\n");



Output example:


Testing 1...2...3...

Hello dude!

Press any key to continue . . .



C and C++ Programming Resources | C & C++ Code Example Index