Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting C to Java 1

Status
Not open for further replies.

tig12

Programmer
Feb 27, 2007
20
0
0
GB
Hi,

I'm trying to convert the following C code to Java but I get an error message "[" should be expected. Does anyone know why I am getting this and what I should change.

ps. Is there a program out there that does this Convert C to Java?




//loop for going through the 2d array
int counter1 = 0;
for (int i = 0; i < 7;i++ )
{
double[] D = new double[3];
int counter = 0;

//inner loop
for (int j = 0; j < 3; j++)
{
D[counter] = smallest(A[counter], bell[j, i]);

counter++;

}

g[counter1] = largest(D);

counter1++;
}
 
Use instead of
Code:
D[counter] = smallest(A[counter], bell[j, i]);
this
Code:
D[counter] = smallest(A[counter], bell[j][i]);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top