Note: This website is archived. For up-to-date information about D projects and development, please visit


Part of TutorialFundamentals


Creating "slots" to store data.


void main() {
  int myInt,

More Information

Declare three separate integer variable called myInt, myint, and MYINT. Like many things in D, variable declarations are a lot like C, C++, and Java. In D, all variables have to be declared before they are used. Note that (again, like C, etc) multiple variables can be declared at once, seperated by commas.

Some Facts About Identifiers

  1. Identifiers must begin with a letter, or an underscore. Use of leading underscores is, however, generally discouraged, as this pattern is used for reserved names, such as _arguments.
  2. Subsequent characters can be numbers or underscores as well as additional letters.
  3. Identifiers can be as long as you want.
  4. Note that variable identifiers in D are case-sensitive. (In the above example, "myInt", "myint", and "MYINT" are separate identifiers.)