alanmin
asked on
Arrays
Is there anyway of sending a 2-d array to a file????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You didn't specify what kind of array it is. Is it an array of
primative types, or object? In either case, you can use a DataOutputStream ans just iterate through the tow arrays:
for( int i= 0; i < array.length; i++ )
{
for( int j = 0; j < array[i].length; j++ )
{
ostream.writeInt( array[i][j] );
}
}
primative types, or object? In either case, you can use a DataOutputStream ans just iterate through the tow arrays:
for( int i= 0; i < array.length; i++ )
{
for( int j = 0; j < array[i].length; j++ )
{
ostream.writeInt( array[i][j] );
}
}
ASKER
got it sorted anyway ta!
ASKER