How to pass an argument by reference to a C++ Interface library function?
古いコメントを表示
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?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Use Prebuilt MATLAB Interface to C/C++ Library についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!