473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

convert ANSI C to C#

Hi,

I am new to C#, but I have very intersting ANSI C code, which I want to see
in .net action.

Does anybody knows some translator which can convert ANSI C code to C#?

Like exceleent C# to VB tool at
http://www.aspalliance.com/aldotnet/...translate.aspx

thank you
Valko
Nov 15 '05 #1
1 2817
thank you Iain for your kind response, it is some Genetic Algorithm, it has
some structures like that one for chromosome:
typedef struct{
allele_t *allele; fitness_t *fitness;}chromosome_t; and that one for
Population:typedef struct { int nochromosome; chromosome_t *chromosome;
int chromosome_length; allele_t minimum_allele_value; allele_t
maximum_allele_value; fitness_t *minimum_fitness; fitness_t
*total_fitness; chromosome_t *fittest_chromosome; chromosome_t
*fittest_acceptable_chromosome;}population_t;and some action like this
one:/************************************************** ********************
* crossover
************************************************** ********************/
inline int crossover( chromosome_t *young_a, chromosome_t *young_b,
const chromosome_t *male, const chromosome_t *female, const int
chromosome_length);cheersValko
"Iain Simpson" <is******@kelvinconnect.com> wrote in message
news:OT**************@tk2msftngp13.phx.gbl...
"valko" <va***@nms-admin.ch> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
I am new to C#, but I have very intersting ANSI C code, which I want to see in .net action.

Does anybody knows some translator which can convert ANSI C code to C#?
C isn't an object oriented language, so what you'll end up with is a C

program with a bit of C# syntax wrapped around it.

If you just want to see the algorithm in action under .Net, you could probably copy/paste it into a C# class, and modify it slightly.

What does this C code that you have do? If it uses lots of malloc() and
library calls from stdio, stdlib, etc.. it's probably going to be more work to convert it than to rewrite it in C# from scratch.

--
Iain Simpson

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Anthony Boudouvas | last post by:
Hi to all, can anyone tells me what is the correct way from the framework to convert OEM characters to Ansi (and the opposite) ?? I mean, i am building an SMS infrastructure and one part of...
4
by: Julia | last post by:
Hi, I need to convert unicode string to ansi string Thanks in adavance.
3
by: nicksop | last post by:
How Can I convert ANSI to OEM with StreamWriter ?
2
by: Clay | last post by:
I need to convert a unicode string to an ansi string. This should not be difficult but I simply cannot find a way to do this. Anyone?
4
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a...
9
by: emagzz | last post by:
Hi all, I need to convert many text file from ANSI to UNICODE. Some body knows if there is a free utility that can do this from the command line so as I can use it inside a batch file. ...
1
codexparse
by: codexparse | last post by:
I am writing a browser program in C++ Builder 6 that loads a web page using the following code: void __fastcall TForm1::ToolButton1Click(TObject *Sender) { wchar_t buff; ...
3
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i have a byte that holds a bunch of data of type REG_MULTI_SZ in UNICODE,. I must convert this byte to a REG_MULTI_SZ in ANSI code. How can i do this,...? TIA,... Regards
7
by: firepol | last post by:
Hello there, I am dealing with files encoded in UTF8 and I can't find a way to convert them into ANSI. I've already searched in google for this since a while, and I'm not achieving the result I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.