Get and set terminal size

FreeSlave via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 19 05:06:57 PDT 2014


I use
ldc2 main.d -L-lcurses
or
dmd main.d -L-lcurses

and following source code:

import std.stdio;

extern(C) int tgetnum(const(char) *id);

int main()
{
     writeln(tgetnum("li"));
     return 0;
}

Note that you don't need to apply toStringz to string literals 
since they implicitly cast to const char*.


More information about the Digitalmars-d-learn mailing list