473,320 Members | 1,814 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,320 software developers and data experts.

Translating Code from C++ to C#

Could someone please tell me, how easy or difficult , it is to transfer code
written in C++ to C#.

I wrote a program for FTP ( in C++), and need to translate that code in C#.
As a beginner of C# I'm not sure how much work is required, and I wanted to
get a feel of it before I started.

If someone could advise.

Thanks
Idris
Nov 15 '05 #1
3 1531
It depends if you use new-style declarations (like the 'new' keyword) or
old-style (like malloc()) - the new-style is quite similar to C#. The main
problem is really memory management and pointers. If your app has tons of
pointers to structures (yuck!!) then you will likely be doing a lot of
coding...

The bottom line is if you took all the pointers and memory management out of
C++ - what's leftover is VERY simlilar to C#..

"Idris Farooqi" <id***@cs.jhu.edu> wrote in message
news:IZ*****************@nwrddc01.gnilink.net...
Could someone please tell me, how easy or difficult , it is to transfer code written in C++ to C#.

I wrote a program for FTP ( in C++), and need to translate that code in C#. As a beginner of C# I'm not sure how much work is required, and I wanted to get a feel of it before I started.

If someone could advise.

Thanks
Idris

Nov 15 '05 #2
It depends entirely on the C++ style. If the C++ programmer expressed the
algorithm straightforwardly, using simple data types, then it will be easy.
If it's full of C++ tricks and obscurities, it won't be.

"Idris Farooqi" <id***@cs.jhu.edu> wrote in message
news:IZ*****************@nwrddc01.gnilink.net...
Could someone please tell me, how easy or difficult , it is to transfer code written in C++ to C#.

I wrote a program for FTP ( in C++), and need to translate that code in C#. As a beginner of C# I'm not sure how much work is required, and I wanted to get a feel of it before I started.

If someone could advise.

Thanks
Idris

Nov 15 '05 #3
On Sat, 23 Aug 2003 19:09:28 GMT, "Idris Farooqi" <id***@cs.jhu.edu> wrote:
Could someone please tell me, how easy or difficult , it is to transfer code
written in C++ to C#.


In addition to the other replies, which focus on the language issues, there
are the underlying platform issues.

It could be as simple as replacing socket with Socket and similar
substitutions, though I haven't looked at the two interfaces (Platform SDK
and .Net Framework) to see if there's more to it that that. And if your
C++ code is for UNIX, it could be far worse. I have no way of knowing
whether you'll come up against any serious problems in regard to this, but
even if you don't, dealing with the platform issues can be far more tedious
and error-prone than just dealing with the language issues.

Gary

Nov 15 '05 #4

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

Similar topics

6
by: Davis Marques | last post by:
hi; I'm translating some PHP scripts to Python and have hit a roadblock with a for statement. If someone could explain to me how one should translate the multiple increment, evaluations, etc....
2
by: Henrik S. Hansen | last post by:
How do you best go about translating characters like '\\n' to '\n'? This is for a configuration file parser, where the "backslash convention" is supported. The naive approach --...
12
by: Charles Law | last post by:
Hi guys A bit of curve ball here ... I have a document (Word) that contains a series of instructions in sections and subsections (and sub-subsections). There are 350 pages of them. I need to...
23
by: gregf | last post by:
I have a paragraph of text pasted into a word document, it's in Polish, complete with polish characters. They show up just fine in word, but the program I use for web page programming, HomeSite,...
0
by: Dylan Phillips | last post by:
I'm interested in how other participants in this new group are implementing SQL Full-Text Search on their Web Sites. How are you translating the user search string: "DirectX managed code" into...
6
by: Jumping Matt Flash | last post by:
The code i'm writing is using VB .NET and is for a web service returning a dataset, which is in turn to be used by an ASP .NET application displaying a datagrid. I'm currently populating a...
1
by: timn | last post by:
Translating Access SQL queries into SQL subqueries. -------------------------------------------------------------------------------- I have a query in Access that uses a subquery, I would like...
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: Can Some body help me translating the following code from classic Vb to Vb.Net Option Explicit Private Sub Command1_Click() On Error GoTo command_error
2
by: Andrus | last post by:
I have resource files in different languages created by VCS 2005 Express. I want to use those files to translate reports at runtime. I have text to be translated as string. I think I need to...
5
by: Andrus | last post by:
I have database containing translations. I'm creating VS 2005 WinForms application which should use this database to translate menu items to user language. I replaced lines in myform.designer.cs...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.