c++ - Implementing pointers and arrays ported to Java -
I am porting some C ++ code to Java using some C-pointer arithmetic. My problem is as follows:
There is a structure that I have implemented as a class:
I have assignments in the original C / C ++ code,
straight mst_edge {int u, v; Double wa; } Mst_edge * tree_edges = new mst_edge [size]; Int node_l = tree_negel- & gt; U; Int node_r = tree_age-> V How is this code possible to convert to Java? The second block declares the mst_gege as the C / C ++ dynamic array. But in the third block of code it uses Tree_Agers as a direct indicator. In relation to memory, is Java equal and references are directly controlled by Java?
Java is equivalent
mst_edge [] tree_edges = new mst_edge [ Size]; Int node_l = tree_eges [0] .u; Int node_r = tree_agegase [0] .v;
Comments
Post a Comment