COME ON CODE ON

A blog about programming and more programming.

Program without header file?

with one comment

So continuing in the series of program without, here are two more programs. The first one is just a valid C program without any header file.

int main()
{
    return 0;
}

The above program will actually compile and run. But you will say it did nothing. So lets have a program without header file which prints something.

extern "C"
{
       int printf(const char *format,...);
}

int main()
{
    printf("Hello World");
    return 0;
}

The only unexplained feature is extern “C”. For more about it read this.

NJOY!
fR0D

Advertisements

Written by fR0DDY

August 7, 2009 at 2:35 PM

Posted in Beautiful Codes

Tagged with , , , , , ,

One Response

Subscribe to comments with RSS.

  1. what’s “*format,…”????

    mish

    January 22, 2013 at 10:45 PM


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: