Java代码:
public static final byte cw_bArray = 0x01;
public static final byte cw_string = 0x02;
byte[] arr1=new byte[]{0x01};
byte[] arr2=new byte[]{0x02};
byte[] arr3=new byte[]{0x03};
byte[] code_ward_arr=new byte[]{cw_bArray,cw_string,cw_bArray};
method:
mount(null,new Object[]{arr1,arr2,arr3}, code_ward_arr);
我正在尝试将此代码转换为 symbian c/c++。我已经完成了这个,但我不知道如何通过任何人帮助我解决这个问题。
static const signed char cw_bArray = 0x01;
static const signed char cw_string = 0x02;
signed char a1 = {0x01};
signed char a2 = {0x02};
signed char a3 = {0x03};
signed char code_ward_arr[] = {cw_bArray,cw_bArray,cw_bArray};
//signed char bbb[] = {a1,a2,a3};
char *bb=new char[2];
bb[0] = a1;
bb[1] = a2;
bb[2] = a3;
mount(NULL, bb[] , code_ward_arr);
方法:
LOCAL_C void mount(signed char initData, char* obj[], signed char codeWord)
{
}
我正在尝试将这部分代码转换为 c java 代码:
Object obj[] = null;
if(codeWord==null){
obj = new Object[10];//Initial Loading Capacity
}else{
obj = new Object[codeWord.length];
}
C代码:
char* obj[] = {NULL};
if(codeWord==NULL)
{
obj = new char[10];
}
else
{
obj = new char[Cwlen];
}
我会得到这个错误非法操作数'char * [1]'='char *'