北京网站优化服务有限公司,app引流推广软件,上海发布网站,建设网站范文看看简单的示例(该示例不使用.di文件): 这里 克隆它并放文件在方便的地方. 现在,试使用它. 在此例中,map.c和app.d在同一目录中.
import std.stdio : writeln;
//使用map.c
import map;
import std.string : toStringz;
alias c toStringz;
void main()
{hashmap* m hashmap…看看简单的示例(该示例不使用.di文件): 这里 克隆它并放文件在方便的地方. 现在,试使用它. 在此例中,map.c和app.d在同一目录中.
import std.stdio : writeln;
//使用map.c
import map;
import std.string : toStringz;
alias c toStringz;
void main()
{hashmap* m hashmap_create();string key hello;hashmap_set(m, key.c, key.length, 400);uintptr_t result;if (hashmap_get(m, key.c, key.length, result)){writeln(key, , cast(int) result);}else{writeln(Could not locate entry , key);}
}如果路径设置正确,现在可运行:
dmd map.c app.dDMD现已生成可执行文件.运行它并查看结果. 好.现在,如果也可获得自动补全等,那就更好了.