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

Changes from Version 1 of DeclaringVariables/D1

Show
Ignore:
Author:
Andrej08 (IP: 78.2.39.16)
Timestamp:
09/06/10 21:13:54 (14 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeclaringVariables/D1

    v0 v1  
     1= Declaring Variables = 
     2 
     3''Part of'' TutorialFundamentals 
     4 
     5In 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 
     9void main() 
     10{ 
     11    int myInteger; 
     12    double myDouble; 
     13    bool myBit; 
     14    string myString; 
     15} 
     16}}} 
     17 
     18== D1.x vs D2.x == 
     19 
     20In version 1 of D, 'string' is an alias for 'char[]' and in version 2 'string' is an alias for 'immutable(char)[]'.