How to convert C code(given below) in java
C code:
struct structA {
int varA[4];
float varB[2];
}
struct structB {
int len;
structA varC[50];
}
void main {
structB varD[10];
.....
.....
somefunction(varD) {
.....
}
}
Here i have a structure A with variables of different data types(some are array)
And also i have a structure B with some variables (one of the variable is of data type of structure A [mind u this is an ARRAY])
In the C code im using array of structure B
And initialising the values of the variable of structure A, obviiously using the dot operator
This works perfectly in C.
In java i used class insted of structure, i thought it would work
But it gives error while initialising values of the variable of structure A( that is class A).
C code:
struct structA {
int varA[4];
float varB[2];
}
struct structB {
int len;
structA varC[50];
}
void main {
structB varD[10];
.....
.....
somefunction(varD) {
.....
}
}
Here i have a structure A with variables of different data types(some are array)
And also i have a structure B with some variables (one of the variable is of data type of structure A [mind u this is an ARRAY])
In the C code im using array of structure B
And initialising the values of the variable of structure A, obviiously using the dot operator
This works perfectly in C.
In java i used class insted of structure, i thought it would work
But it gives error while initialising values of the variable of structure A( that is class A).