Skip to content

How to Pass TypeScript Number Array to C++? #1

@chhsgithub

Description

@chhsgithub

Hello,

I am currently working on a project where I need to pass an array of numbers from TypeScript to C++. I couldn't find any clear documentation or examples related to this.

typescript:
let numArray: number[] = [0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5 ];

cpp:
std::vector parser(std::vector input){
for (int i = 0; i < input.size(); i++)
{
input[i]++;
}
return input;
}

I would like to know how I can pass this numArray to a C++ function and access its elements.

Questions:
Is there any recommended method to do this?
Are there any data type constraints or considerations I should be aware of while passing the array?
Any guidance or reference to documentation would be greatly appreciated. Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions