Could use help editing this C OpenCV code so it will run ....uses CvGraph
I could use help getting the code here to run http://blog.csdn.net/honpey/article/details/8795228 directly underneath the three typdef structs and the and the graph picture... Im trying to run it to learn about CvGraph struct and related functions. when i run it i get error:
error: ‘Edges_addr’ was not declared in this scope cvGraphAddEdge(graph,edge_start[i],edge_end[i],&Edges[i],&Edges_addr[i]);
I dont want to edit it myself because i wouldnt know how to edit but still preserve the authors intention ....so i could use help just declaring edges_addr correctly and understanding what the new operator is doing on this line(line 22)
CvGraphEdge *Edges = new CvGraphEdge[EdgeNum];
I know CvGraphEdge is a struct so is it essentially doing this :
(CvGraphEdge)malloc(sizeof(CvGraphEdge*EdgeNum)) ?
any help on this is greatly valued=)
Cheers!
ps need to use C for a project is why =)
CvGraphEdge * Edges = (CvGraphEdge*)malloc(sizeof(CvGraphEdge)*EdgeNum);
(2 errs in 1 line.)
and you've seen, that it's using set and queue ? good luck porting that back to c.
@berak what do you mean by good luck porting that into c ...isnt what you provided the correct translation of the new operator line in c...thx btw 4 that =) ....also can you help me with the Edges_addr part of my ?
i mean you can't run it with a c compiler
can't help you with the rest. that code is simply not complete.
and the next time, you see comments in chinese, or french, or croatian - run!!
@berak thx for the info that helped me get started... any way you can post a piece of your old code that uses Cvgraph...maybe something thats easy to grasp for a CvGraph noob:)