How to pass an argument by reference to a C++ Interface library function?
Show older comments
I have the following C++ header file.
// sample header.hpp
#include <vector>
// fills in the input vector
void getData(std::vector<char>& arr) {
char data [] = {'M', 'A', 'T', 'L', 'A', 'B', '\0'};
arr.clear();
for (auto c : data) {
arr.push_back(c);
}
}
The argument for the getData function needs to be passed by reference. How can I do that with the C++ Interface?
Accepted Answer
More Answers (0)
Categories
Find more on Call C++ from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!