Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to convert ANSI C code to C#?

Tags:

I need to import some ANSI C code into a project I'm working on. For reasons I prefer not to go into, I want to refactor the code to C# rather than trying to wrap the original code. It will take me perhaps a couple of days to do the work by hand, but before I start, is there an automated tool that can get me most of the way there? I'm a cheapskate and the work I'm doing is pro bono, so free tools only please.

like image 835
Tim Long Avatar asked May 11 '09 17:05

Tim Long


2 Answers

If manual refactoring is "only" going to take a few days, that would get my vote. Depending on what the C code is doing and how it is written (pointers, custom libraries, etc.) an automated converter may just make a mess. And untangling that mess could be a larger task than just converting by hand.

like image 187
Mark Maslar Avatar answered Oct 11 '22 23:10

Mark Maslar


Setting up, cleaning up, refactoring, and just plain making converted code (if there is even a converter available) would probably be something in the magnitude of weeks or months, so you'll be better served just to go ahead with the manual rewrite.

like image 32
Michael Meadows Avatar answered Oct 11 '22 23:10

Michael Meadows