Changes between Version 3 and Version 4 of VariablesExample
- Timestamp:
- 01/03/06 05:22:57 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VariablesExample
v3 v4 11 11 {{{ 12 12 #!d 13 14 void main() 15 { 16 int myInt; 17 int myint; 18 int MYINT; 13 void main() { 14 int myInt, 15 myint, 16 MYINT; 19 17 } 20 21 22 18 }}} 23 19 24 20 == More Information == 25 21 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. 22 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. 31 23 32 24 === Some Facts About Identifiers === 35 27 1. Identifiers can be as long as you want. 36 28 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 ||