TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ken H
NA
646
360.2k
To set the value of a two-dimensional array in c++ dll
Mar 19 2015 6:09 AM
Hello friend,
The following code will not run properly.
C++ codes:
// mytest.cpp
#include "stdafx.h"
#include <string.h>
#include <stdio.h>
extern "C"{
_declspec(dllexport) void _setv(char ***s, int row, int column){
for (int i = 0; i < row;i++){
for (int j = 0; j < column;j++)
{
strcat(s[i][j],"The value in here.");
}
}
}
}
C# codes:
class Program
{
[DllImport("mytest.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void _setv(string[,] s, int row, int column);
static void Main(string[] args)
{
string[,] _arr = new string[2, 2]{{"",""},{"",""}};
_setv(_arr, 2, 2);
}
}
Thank.
Reply
Answers (
4
)
How to read data from check box in PDF using iTextsharp?
c# how to get two output params from sqlserver