write a function that will reverse the numbers in a row?
so far done
public void fliprow(int r)
{
int temp = m[r][m[r].length-1];
int ct = 1;
for(int column = m[r].length; column >= 0; column--)
{
m[r][column] = m[r][ct];
m[r][ct] = temp;
temp = m[r][m[r].length-ct];
if(ct < m[r].length)
ct++;
else
ct = ct;
}
}
conztantines
0
Newbie Poster
Recommended Answers
Jump to Postouch, that makes my head hurt.
How about something like this instead?
private int[][] array = new int[][] { {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 0, 1} }; public void println() { for (int i = 0; i < array.length; i++) { …
All 2 Replies
ztini
ztini
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.