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

Changes between Version 3 and Version 4 of VariablesExample

Show
Ignore:
Author:
csauls (IP: 69.166.134.113)
Timestamp:
01/03/06 05:22:57 (18 years ago)
Comment:

Goodbye, "Source," and hello multi-decleration explanation.

Legend:

Unmodified
Added
Removed
Modified
  • VariablesExample

    v3 v4  
    1111{{{ 
    1212#!d 
    13  
    14 void main() 
    15 
    16     int myInt; 
    17     int myint; 
    18     int MYINT; 
     13void main() { 
     14  int myInt, 
     15      myint, 
     16      MYINT; 
    1917} 
    20  
    21  
    2218}}} 
    2319 
    2420== More Information == 
    2521 
    26 Declare three separate integer variable called myInt, myint, and MYINT. 
    27  
    28 Like many things in D, variable declarations are a lot like C, C++, and Java. 
    29  
    30 In D, all variables have to be declared before they are used. 
     22Declare 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. 
    3123 
    3224=== Some Facts About Identifiers === 
    3527 1. Identifiers can be as long as you want. 
    3628 1. Note that variable identifiers in D are case-sensitive. (In the above example, "myInt", "myint", and "MYINT" are separate identifiers.) 
    37  
    38  
    39 == Source == 
    40  
    41 || Link || http://www.dsource.org/tutorials/index.php?show_example=73 || 
    42 || Posted by || jcc7 ||