简体   繁体   English

在Java中相当于char **

[英]char** equivalent in Java

I am converting a C++ project into Java. 我正在将C ++项目转换为Java。 I have one doubt, what is the equivalent of char** in Java, is it String[] or String[][] ? 我有一个疑问,Java中char**的等效项是String[]还是String[][]

char[][] or String[] . char[][]String[] Depends on context 取决于上下文

You can't really express the meaning of char** in Java so there's no equivalent, but if that's actually a pointer to the first element of an array of zero-terminated C-strings, then String[] is as close as you can get. 您实际上无法在Java中表达char**的含义,因此没有等效的含义,但是,如果实际上它是指向零终止C字符串数组的第一个元素的指针,则String[]尽可能接近得到。

If it's a two-dimensional "pseudo-array" of char , then char[][] is close enough. 如果它是char的二维“伪数组”,则char[][]足够接近。

If it's neither but just a pointer to a pointer, then there's no equivalent. 如果既不是指向指针的指针,则没有等效指针。

I would say String[] if I remember correctly. 如果我没记错的话,我会说String []。 String is a handle and that would be an array of handles. 字符串是一个句柄,它将是一个句柄数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM