Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2024/25/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Hello, World!

See also std.stdio.

(1) hello world
#include <stdio.h>

int main()
{
    printf("hello\n");

    return 0;
}
#!/usr/bin/env rdmd

import std.stdio;

void main()
{
    writeln("D Lang");
}
  • Although the return type is void, the program quits with the exit code 0 if there was no problem.
  • If you want, you can be explicit and indicate int as the return type and return 0; at the end, but it's not necessary.

Run it "as a script", if you have rdmd installed:

# v1
$ rdmd main.d
D Lang

# v2
$ chmod u+x main.d
$ ./main.d
D Lang

Compiling:

$ dmd main.d
$ ./main
D Lang

$ dmd main.d -of=a.out
$ ./a.out
D Lang
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 June 23, 09:50