logo
  • 教程列表
  • SO官方文檔
  • 匯入和模組
    • 全域性匯入
    • 選擇性匯入
    • 本地匯入
    • 公共匯入
    • 重新命名為匯入
    • 重新命名和選擇性匯入
    • 模組宣告
  1. StackOverflow 文件
  2. D Language 教程
  3. 匯入和模組
  4. 全域性匯入

全域性匯入

Created: November-22, 2018

import std.stdio;
void main()
{
    writeln("Hello World!");
}

可以在同一行中指定多個匯入,使用 comma 或新行分隔。

import std.stdio, std.math;
import std.datetime;
void main()
{
    writeln("2^4: ", pow(2, 4));
    writeln("Current time: ", Clock.currTime());
}
  • 選擇性匯入
  • 匯入和模組

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明