Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

D stuff

import std.stdio;
import std.datetime;

void arg_demo(string[] args) 
{
    int argc = 0, total = 0;
    foreach(arg; args) {
        printf("arg[%i] = \"%s\"\n", argc++, arg.ptr);
    }
    write("\nargs = ", argc, "\ntotal = ", total, "\n\n");
}

void ascii_demo()
{
    char c;
    for(c = ' '; c < 128; ) {
        write(c);
        if(++c % 32 == 0)
            write('\n');
    }
    write('\n');
}

void print_datetime() 
{
    SysTime now = Clock.currTime();
    writeln(now.toISOExtString());
}

void main(string[ ] args)
{
    arg_demo(args);
    ascii_demo();
    print_datetime();
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.