|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
D - array declaration with type of subscript.
int [300] a; // declares a as an array of integer of size 300. How about to make declare the type of the subscript expression for an array ? int [300] a; int [int 300] a1; int [long 300] a2; int [char 300] a3; int [uint 300] a4; int [long 300] a4; int [ulong 300] a5; int [] x; int [int] x1; int [long] x2; int [char] x3; int [uint] x4; int [long] x5; int [ulong] x6; etc. the specification of the type of the array bound indicates what kind of the array subscript expression is expected. Hiroshi Murakami Jun 12 2004
dm tmca.ac.jp wrote:int [300] a; // declares a as an array of integer of size 300. How about to make declare the type of the subscript expression for an array ? int [300] a; int [int 300] a1; int [long 300] a2; int [char 300] a3; int [uint 300] a4; int [long 300] a4; int [ulong 300] a5; int [] x; int [int] x1; int [long] x2; int [char] x3; int [uint] x4; int [long] x5; int [ulong] x6; etc. the specification of the type of the array bound indicates what kind of the array subscript expression is expected. Hiroshi Murakami Jun 12 2004
|