- Learning D
- Michael Parker
- 222字
- 2021-07-30 10:13:53
Chapter 2. Building a Foundation with D Fundamentals
In this chapter and the next, we're going to look at the fundamental building blocks of D programming. There's a lot of information to cover, so our focus in both chapters will primarily be on the syntax, differences from other C-family languages, and how to avoid common beginner mistakes.
If you enter the code snippets into a text editor and try to compile them as you work through this chapter and the rest of the book, please keep the following in mind. Many of the snippets make use of one or more functions from std.stdio
. In order to be successfully compiled, they all require a main
function. However, both declarations are often missing from the snippets listed in the book in the interest of saving space. Use the following as a template to implement any such snippets yourself:
import std.stdio; void main() { // Insert snippet here }
Here's how this chapter is going to play out:
- The very basics: Identifiers, scope, modules, comments, variable declarations, and initialization
- Basic types: Integral and floating-point types, aliases, properties, and operators
- Derived data types: Pointers, arrays, strings, and associative arrays
- Control flow statements: Loops, conditionals, scope, and go to statements
- Type qualifiers: Immutable and const
- Functions: Everything to do with functions
- MovieMan: The first steps
- 精通Nginx(第2版)
- Rake Task Management Essentials
- Java游戲服務器架構實戰
- Julia機器學習核心編程:人人可用的高性能科學計算
- PHP+MySQL網站開發項目式教程
- FLL+WRO樂高機器人競賽教程:機械、巡線與PID
- 從0到1:Python數據分析
- H5頁面設計:Mugeda版(微課版)
- AppInventor實踐教程:Android智能應用開發前傳
- Android移動開發案例教程:基于Android Studio開發環境
- 深入理解BootLoader
- Building Slack Bots
- 零基礎輕松學C++:青少年趣味編程(全彩版)
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- Web開發的平民英雄:PHP+MySQL