woodwardiocom: (Ulam Spiral)
[personal profile] woodwardiocom
Dennis Ritchie, developer of the C programming language, passed on a few days ago, closing his final curly-brace. The influence of C on the art and science of programming cannot be overstated. I spend most of my working hours using C# and JavaScript, two languages which simply would not exist without C. C, in its simplicity and depth, simply got a lot of things right. Ritchie's legacy endures.

(News courtesy [livejournal.com profile] ceo.)

Date: 2011-10-14 05:50 am (UTC)
From: [identity profile] trowa-barton.livejournal.com
#include
[Error: Irreparable invalid markup ('<stdio.h>') in entry. Owner must fix manually. Raw contents below.]

#include<stdio.h>

main()
{
printf("Goodbye Dennis");
}

Date: 2011-10-14 11:04 am (UTC)
From: [identity profile] woodwardiocom.livejournal.com
That's int main, citizen.

Date: 2011-10-14 02:20 pm (UTC)
From: [identity profile] trowa-barton.livejournal.com
Sorry. Copy and paste error.

#include
[Error: Irreparable invalid markup ('<stdio.h>') in entry. Owner must fix manually. Raw contents below.]

Sorry. Copy and paste error.

#include<stdio.h>

int main()
{
printf("Goodbye Dennis");
}

Date: 2011-10-14 04:07 pm (UTC)
From: [identity profile] danceboy.livejournal.com
Doesn't that depend what generation you're from? ISTR K&R C assumed int if you didn't specify. I don't have my copy here to check (I don't even have a current copy at work...).

Date: 2011-10-14 04:23 pm (UTC)
From: [identity profile] woodwardiocom.livejournal.com
Based both on what I recall, and a quick scan of the "Main function" article at Wikipedia, "int main" appears to be standard for C qua C.

Date: 2011-10-14 05:18 pm (UTC)
From: [identity profile] danceboy.livejournal.com
Well, yeah, these days. Ever since ANSI which was in what, 91? Ah, wikipedia says 90.

But a little above that, referring to K&R C, it says "a function used without any previous declaration was assumed to return type int". And I vaguely recall experimenting when I was learning C in the late 80s, and finding out just how much I could omit, and being able to omit that.

AHA! yes, scroll down and you get this:
The original version was:[16]

main()
{
    printf("hello, world\n");
}


Profile

woodwardiocom: (Default)
woodwardiocom

February 2020

S M T W T F S
      1
23 4 5678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 14th, 2026 11:01 pm
Powered by Dreamwidth Studios