c

warning: Creating default object from empty value in /homepages/34/d93266176/htdocs/el-badawy/modules/taxonomy/taxonomy.pages.inc on line 33.

Declarations and Definitions

  • storage class specifier: extern, static, auto, register, typedef
  • type specifier: void, char, int, unsigned,
  • type qualifier: const, restrict, volatile
  • All instances of a particular name with external linkage refer to the same object in the program
  • Unless prefixed it with extern, the declaration of a data object at the outer level is also a definition
  • A function prototype is a declaration of a function that declares the types of its parameters.

file1.c:

int x;  /* a declaration, and also a definition, external linkage */

C Hello World

#include     // printf
#include     // exit

int main() {
    printf( "Hello World\n" );
    exit( EXIT_SUCCESS );
}

Windows minimal

A real minimal Windows program.

#include windows.h

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow ) {
	MessageBox( 0, "Hello World", "Caption", 0 );
	return 0;
}
Syndicate content