C++ to C# conversion tool

Soldato
Joined
19 Jun 2009
Posts
3,915
I have some C++ code I have sourced from the net, and I'm trying to convert the code to C#.

Does anyone know of any good on-line tools that would automatically do the conversion process.

Cheers
Jason
 

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,325
Location
Derbyshire
Short answer: Impossible.
Long answer: Highly improbable.

Can you post the code? If it's not massive I'm sure I/someone else can help you convert it. Automatically converting between languages isn't easy, especially from say C++ to C# which are totally different (bar the roughly similar syntax).
 
Soldato
OP
Joined
19 Jun 2009
Posts
3,915
Thanks for the responses. The C++ is some quite complicated Neural Network code.

I knew nothing would help with libraries, but hopefully something to help with converting syntax.

One option is to keep the C++ code original, then use P/invoke to call as a function.

Pho, or anyone else who wants to look at the C++ code then I would be grateful :). I have looked at C++ in the past but i'm rusty, i'm really a .Net / c# person.

http://www.yourmenu.co.uk/other/ESOIINN.rar
 

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,325
Location
Derbyshire
Yeah, that's not going to take 5 minutes to convert :p. How come you need it converted to C#?

Like you say, you'd probably be better off P/invokeing it or just building it as a C++ exe then having your C# app execute that exe in the background to do what it needs.

We had some guys from Imperial in at work talk to us about Cuda Convnet the other week which is apparently very fast as it uses CUDA, might be another idea for you.
 
Caporegime
Joined
18 Oct 2002
Posts
32,623
Thanks for the responses. The C++ is some quite complicated Neural Network code.

I knew nothing would help with libraries, but hopefully something to help with converting syntax.

One option is to keep the C++ code original, then use P/invoke to call as a function.

Pho, or anyone else who wants to look at the C++ code then I would be grateful :). I have looked at C++ in the past but i'm rusty, i'm really a .Net / c# person.

http://www.yourmenu.co.uk/other/ESOIINN.rar


TBH, just program in C++ if you are doing things like machine learning. C# will just be slow and painful.
 
Associate
Joined
4 Apr 2011
Posts
259
I have heard about such a tool in the past. I don't actually recall the name but I remember it was made by a Russian company. Anyway, it didn't work perfectly and did some strange things when converting to C#. It was paid and quite expensive also, so it may not suit you.
 
Back
Top Bottom