<div dir="ltr"><div><div><div><a href="http://docs.opencv.org/modules/core/doc/basic_structures.html">http://docs.opencv.org/modules/core/doc/basic_structures.html</a><br></div><br>CvPoint2D32f is a C structure, so you should be able to replace new CvPoint2D32f[ board_n ]; with malloc(sizeof (CvPoint2D32f) * board_n); but new upon a struct type in C++ also initializes the contents to the appropriate zero values, so you'll need to add code to do that yourself.<br>
<br></div>Test it in the example code, and see if you can compile and run it with a C compiler.<br><br></div>Once you can do that, cffi should be straight-forward to use.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Oct 28, 2013 at 5:15 PM, Joeish W <span dir="ltr"><<a href="mailto:joeish80829@yahoo.com" target="_blank">joeish80829@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">
<div>Im converting this code here</div><div><tt><br></tt></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:monospace"><tt>
        int board_n = board_w * board_h; <br></tt></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:monospace"><tt>    CvPoint2D32f* corners = new CvPoint2D32f[ board_n ];</tt></div>
<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br>from this link <a href="http://dasl.mem.drexel.edu/~noahKuntz/openCVTut10.html" target="_blank">http://dasl.mem.drexel.edu/~noahKuntz/openCVTut10.html</a><br>
</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">and in the code is a new operator id like to convert but i could use guidance how.</div>
<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">first of all i looked on google and there actually doesnt appear to   be a C new operator only C++ which is a little weird because the code at the above link is full of only OpenCV C functions so either there is a C new operator or the author is using C and C++ together. I was going to do foreign-alloc but at this<a href="http://en.cppreference.com/w/cpp/memory/new/operator_new" target="_blank"> link</a> about the new operator for C++ it says <br>
"Allocates<code>count</code>bytes from free store. Calls the function pointer returned by <span><a href="http://en.cppreference.com/w/cpp/memory/new/get_new_handler" title="cpp/memory/new/get new handler" target="_blank">std::get_new_handler</a></span> on failure and repeats allocation attempts until new handler does not return or becomes a null pointer, at which time throws <span><a href="http://en.cppreference.com/w/cpp/memory/new/bad_alloc" title="cpp/memory/new/bad alloc" target="_blank">std::bad_alloc</a></span>."<br>
<br>I dont really know what to make of that and that link is for C++...thus the reason for my question....any guidance is appreciated<br></div></div></div></div></div></div></div></div></blockquote></div><br></div>