When I am interacting with a c-style function which style should I use.
I do plan on storing the data in a vector after it comes back from the c function. What are advantageous of one over the other?
{
auto test = std::make_unique<double[]>(10);
fooCstyle(test);
}
or
{
auto test = std::vector<double>;
test.reserve(10);
fooCstyle(test);
}
In this case it makes no difference, it depends on what you want to do with that data later in cpp-styled code.
However your examples are wrong, it should look like this:
or