Hi all,<div><br></div><div>I'm trying to figure out how to pass in an array of integers to a function inside a module. For example, adding the following function to runit.Module.R works fine:</div><div><br></div><div>
<div> int bla3( IntegerVector x ) {</div><div> return sum(x);</div><div> }</div></div><div><br></div><div>However, I need to pass an int array, rather than an IntegerVector. Using int x[] in the arguments doesn't compile (though I'm unfamiliar with C++ in general, so maybe this shouldn't work anyway). </div>
<div><br></div><div>Alternatively, should I just cast x from an IntegerVector to an int array? I tried various permutations of as, vector, <int>, etc, and would like to learn the proper way of doing this.</div><div>
<br></div><div>Thanks in advance,</div><div>Chris</div>