TCHAR 2维数组通过引用传递 [英] TCHAR 2 dimensional array pass by refernce

查看:70
本文介绍了TCHAR 2维数组通过引用传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..
我必须通过函数通过引用传递TCHAR 2D数组.
例如:

Hi..
i have to pass a TCHAR 2D array by reference through a function.
Eg:

Function1(tcStringList); // calling function, tcStringList is 2D array of 3 strings, each of size allocated to "MAX_LENGTH".

//function body
Function1(TCHAR* tcStringList[][MAX_LENGTH])// Is this syntax correct?
{
// here do memcopy and store values to tcStringList
}



我没有获得如何传递2D TCHAR数组的语法.


有人可以给我提供解决方案吗?



I am not getting the syntax of how to pass the 2D TCHAR array.


Can anyone provide me the solution?

推荐答案

尝试一下-Function1(TCHAR* tcStringList[3])


我已按照您的说明插入.但返回了错误.无法将参数1从"TCHAR [3] [32]"转换为"TCHAR * []
错误是在调用函数.

在调用函数之前,我已经初始化了2D数组,如下所示:-
TCHAR tcSringList [3] [32] = {_ T("\ 0")};
Function1(tcStringList);
i inserted like you said. but it returned error.. cannot convert parameter 1 from ''TCHAR [3][32]'' to ''TCHAR *[]
error was in calling function.

Befor calling the function, i have initialized the 2D array as below:-
TCHAR tcSringList[3][32]={_T("\0")};
Function1(tcStringList);


TCHAR tcStringList[3][32]={_T("\0")};


void Function1( TCHAR tcStringList[][32])
{
  // here do memcopy and store values to tcStringList
}



:)



:)


这篇关于TCHAR 2维数组通过引用传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆