请教 这段代码是什么意思
tomqyp
2007-09-23
char[] word; .............. if( word[$ - 1] == '.' ) word = word[0..$ - 1]; 好像是去除最后一位,能介绍下关于$符号吗 |
|
Colorful
2007-09-23
等价于
char[] word; ............. if(word[length-1] == '.') word = word[0..length-1]; |
|
Colorful
2007-09-23
在D语言规范的数组章节中有记载。
http://www.digitalmars.com/d/arrays.html Array Length Within the [ ] of a static or a dynamic array, the variable length is implicitly declared and set to the length of the array. The symbol $ can also be so used. |
|
tomqyp
2007-09-23
谢谢
|
相关讨论
相关资源推荐
- 编写WTL资料《WTL for MFC Programmers》
- WTL for MFC Programmers(1)
- WTL for MFC Programmers, Part IX - GDI Classes, Common Dialogs, and Utility Classes
- WTL for MFC Programmers, Part VI - Hosting ActiveX Controls
- WTL for MFC Programmers, Part II - WTL GUI Base Classes
- WTL for MFC Programmers, 中文版序言
- WTL for MFC Programmers,Part IV - Dialogs and Controls
- WTL for MFC Programmers英文版PDF,附演示代码
- WTL for MFC Programmers(中文版)
- WTL简单教程WTL for MFC Programmers