Changes from Version 1 of DeclaringVariables/D1
- Timestamp:
- 09/06/10 21:13:54 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeclaringVariables/D1
v0 v1 1 = Declaring Variables = 2 3 ''Part of'' TutorialFundamentals 4 5 In order to store information within a D program, you must declare variables before they are used. The syntax is ''name_of_type'' ''identifier''. 6 7 {{{ 8 #!d 9 void main() 10 { 11 int myInteger; 12 double myDouble; 13 bool myBit; 14 string myString; 15 } 16 }}} 17 18 == D1.x vs D2.x == 19 20 In version 1 of D, 'string' is an alias for 'char[]' and in version 2 'string' is an alias for 'immutable(char)[]'.