arrays

BCS ao at pathlink.com
Mon Jan 28 22:11:59 PST 2008


Reply to tytower,

> [code]
> this() {
> char[][] data ;
> char[] dataNumber = "1";
> char[] date = "10/12/08" ;
> char[] m_details = "test";
> char[] m_code = "340" ;
> char[] m_debit = "3480.00";
> char[] m_credit;

   data.length = 6;

> data[0]= dataNumber;
> data[1]= date ;
> data[2]= m_details;
> data[3][ m_code;
> data[4]= m_debit;
> data[5][ m_credit;
> [/code]
> Compiles OK but gives error
> [code]
> "tango.core.Exception.ArrayBoundsException at transaction(56): Array
> index out of bounds"[/code]

untill you say otherwise a dynamic array has size zero.




More information about the Digitalmars-d-learn mailing list