Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to pass an array as parameter to C function ??

Posted on 2003-11-03
1
Medium Priority
?
322 Views
Last Modified: 2010-04-16
I have a DLL in C code (win32 DLL)

I want to use it in my C#.

the prototype of my C function :       int** allocation(int** r, int m, int n)

in my C#, i have made a DLLImport.
The return "work". In an usafe part i create an int**, ...

But i don't know how to create an int** and affect it in order to pass it in param

unsafe
                  {
                        int** tutu;
                        int** toto;

                        tutu = allocation(toto, 2, 2);     // toto is not assigned

                                                               .....
                                                  }

I can access to "tutu" after ... but assign "toto" ????

Is it the right way ? How create the array ?

Thanks
0
Comment
Question by:regdobey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
nicog76 earned 750 total points
ID: 9671803
In your DLLimport you had to put " [In] int[,] " for the int*, and use an int[,] in safe.

good luck
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question