[Info-vax] VMS Cobol - GnuCOBOL
Arne Vajhøj
arne at vajhoej.dk
Fri Feb 24 09:05:27 EST 2023
On 2/23/2023 6:43 PM, Arne Vajhøj wrote:
> And C# is not like C at all. Besides using curly braces and
> having the 3 arg for loop then I do not see much similarity.
>
> Just compare the hello worlds:
>
> #include<stdio.h>
>
> int main()
> {
> printf("Hello world!\n");
> return 0;
> }
>
> VS:
>
> using System;
>
> public class HelloWorld
> {
> public static void Main(string[] args)
> {
> Console.WriteLine("Hello world!");
> }
> }
>
> (C# pre-V9.0)
And in case someone wonder if C# 9.0 broke hello world.
The above hello world still compiles and run fine with
C# 9.0 and later.
But it can be written as:
using System;
Console.WriteLine("Hello world!");
:-)
Arne
More information about the Info-vax
mailing list