English 中文(简体)
翻译 code
原标题:translate c++ code into java

I need to translate some c++ into java, but I have I few issues.

在方法中被宣布为论据时,我怎么要与点人打交道?

static void test( double *output){}

另外,我是怎样的,又如何取而代之?

struct test { int t;
int arg;
float *pva;
double *array;
}

然后,在法典中,他们使用:

double test(struct test *test)
{}

奥赫和最后一点,也是在结构试验中,这意味着:

test->arg
问题回答
static void test( double *output){}

这需要更多的背景,可能意味着两倍或两倍。

struct test { int t;
int arg;
float *pva;
double *array;
}

缩略语 您可代之以<代码>的公开成员。

test->arg

可查阅arg member in test

你在 Java没有点人,只字眼,只指物体(不是原始类型)。 参考资料与点人一样,但你使用的是点名,而不是点名; 此外,你不需要在 Java删除物体,你只是停止使用这些物体,并最终停止垃圾收集器销毁。

Answering your points above, from bot纽约总部m 纽约总部 纽约总部p: If test is a pointer 纽约总部 a struct or class in C++, and arg is a member variable of test, then

test->arg

使用该成员通过点子接触。 这将勾画出来。

test.arg

在 Java,如果rg是试剂的一个公共成员变量。

我将翻译如下:

struct test
{
    int t;
    int arg;
    float *pva;
    double *array;
}

...

double test(struct test *test)
{}

纽约总部

public class Test
{
    public int t;

    public int arg;

    float [] pva;

    double [] array;
}

...

public static double test(Test test)
{}

第一种情况,即职能

static void test( double *output){}

you cannot pass a pointer 纽约总部 double and modify the double in Java. You have 纽约总部 return a double. If you need the double also as an input parameter, you specify it as a normal parameter that is passed by value:

static double test(double output)
{}

我希望这一帮助。

在简单情况下,你可以取代<代码>float *和double * with float []double [ ]。

页: 1

如果你想要了解基本的C++辛瓦克斯,我建议你读出一份关于如何在C++进行规划的指南。

(1) <代码>静态真空试验(双重数据输出){>

可在<代码>Double[<>/code>上替换<>Double[>(假定您有new Double[]),该方法可放在<代码><>>>>>。

class testMethod {
  public static void test (Double []output) { }
}

(2) how can I replace struct? It can be replaced with a class.

class test {
public int t;
public int arg;
public Float []pva;
public Double []array;
}

(3) double test(struct test *test) {} It can be,

double test (test t) {}

(4) test->arg

Java don t有点人(尽管它已经执行,但上述说明将载于test.arg





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签