如何在Java/C ++中转换C#代码 [英] How do I convert C# code in java/C++

查看:547
本文介绍了如何在Java/C ++中转换C#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tried converting to java but LinkedListNode implementation in c# is something i am having trouble with and its related functionality.

Can someone help me with c++/java version of about code. (it seems to use Havel-Hakimi theorem and I am not really familiar with c# to understand the logic behind it but i was able to run above code with some googling)

Would really like help with conversion as java/c++(familiar with) will give me better understanding about the method/algorithm used in above code



我尝试过的事情:

我尝试将其转换为Java,但是用c#实施LinkedListNode却是我遇到的麻烦及其相关功能.

有人可以为我提供有关代码的c ++/java版本的帮助. (它似乎使用了Havel-Hakimi定理,而我对C#并不是很了解,无法理解其背后的逻辑,但是我可以使用一些谷歌搜索功能在上面的代码上运行)

真的很想帮助转换,因为java/c ++(熟悉)将使我对上面的代码中使用的方法/算法有更好的了解.



What I have tried:

Tried converting to java but LinkedListNode implementation in c# is something i am having trouble with and its related functionality.

Can someone help me with c++/java version of about code. (it seems to use Havel-Hakimi theorem and I am not really familiar with c# to understand the logic behind it but i was able to run above code with some googling)

Would really like help with conversion as java/c++(familiar with) will give me better understanding about the method/algorithm used in above code

推荐答案

您可以尝试在线像这样的翻译器: CodeTranslator:VB.NET的代码翻译<-> C#- TypeScript<-> Java [^ ]
但这仅适用于简单的程序...
You can try an online translator like this one: CodeTranslator: Code Translation From VB.NET <-> C# <-> TypeScript <-> Java[^]
But these will only work for simple programs ...


要在Java中进行翻译,您必须为每个类创建一个带有该类名称的文件.对于C ++,您必须使用声明创建头文件并使用范围语法.

不应该很难重写它.主要功能和内存分配有些不同,您应该在Google上搜索一些教程,例如学习C ++ .
For translation in java you must create for each class a file with the name of the class. For C++ you must create a header file with declarations and use the scope syntax.

Shouldnt be to hard to rewrite it. The main functions and memory allocations are a bit different, you should google for some tutorials like to Learn C++.


这篇关于如何在Java/C ++中转换C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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