c# marshaling, returning vector from c++

hello, I want to return vector or something like that from c++ and use it in c#, only purpose is passing 50 integers to c# how can I do it?

I have the following code this works perfectly but I want something else.

in c#

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Runtime.InteropServices;

public class simple_code : MonoBehaviour {
[DllImport("C++ unitshi.dll")]
static extern int add(int a, int b);
Text text;
// Use this for initialization
void Start () {
text = GetComponent<Text>();
}

// Update is called once per frame
void Update () {
text.text = add(4, 600).ToString();
}
}

in c++

#define MYSHARED_API __declspec(dllexport)
extern "C" {
MYSHARED_API int add(int a, int b);
}

I have not deep understanding of whats going on here, but I wants to know it. so how can I do it?
thank you!
Last edited on
Topic archived. No new replies allowed.