NyTR0
asked on
convert or copy an array of struct to an array (or something I can use)
I have this
Mystruct array[] = new array[100];
for()...
System.out.print (array[i].ThirdElementOfMy Struct); // it works
but I would copy array[i].ThirdElements into an array
What can I do ?
Mystruct array[] = new array[100];
for()...
System.out.print (array[i].ThirdElementOfMy
but I would copy array[i].ThirdElements into an array
What can I do ?
ASKER
Unfortunaltely the type of the field is not an object but int,
another question: array[i].ThirdElementOfMyS truct can return many values of ThirdElementOfMyStruct (example: 1332 and 955) and I would see if I can find the value 67343 for example in array[i].ThirdElementOfMyS truct
Is it possible?
another question: array[i].ThirdElementOfMyS
Is it possible?
System.out.println("Serial number"+ dda[i].snr);
// it prints
Serial number 23432
Serial number 67343
Serial number 43556
.........
// I would know if 67343 is contained in dda[i].snr
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If that is correct, then there is no way of doing this in a single operation. It would have to be done much like the printing. Set up an array, and then copy the stuff into it:
ThirdElementObj eoarray[]=new ThirdElementObj[100];
for(i=0; i<100; ++i)
eoarray[i]=array[i].ThirdE