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

Implicity convertion C++ -> C#

Hi,
I'm translating some code from C++ to C#,
but I don't know how to change the code below to get it working under C#
...., I've tried explicity convertion, but without any results :(
Please help....

int b = -1;
uint a,c = 0;

Encoding encodingAscii = Encoding.GetEncoding(1250);
Encoding encodingUnicode = Encoding.Unicode;

unchecked
{
for (int i=0;i<multiParam.Length;i++)
{
byte[] unicodeBytes = encodingUnicode.GetBytes(multiParam[i]);
byte[] asciiBytes =
Encoding.Convert(encodingUnicode,encodingAscii,uni codeBytes);

for (int j=0;j<asciiBytes.Length;j++)
{
c = asciiBytes[j];

//the problem starts here...

a = (c ^ b) + (c << 8);
b = (a >> 24) | (a << 8);
}
}
}

Regards.

Nov 16 '05 #1
0 1561

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

Similar topics

1
by: Petr Studenovsky | last post by:
Hello I made small GUI test program in Visual Basic NET for SQL communication. I need some help with these problems. problem 1) If I change some settings in datagrid from properties window...
0
by: Konstantin Kivi | last post by:
I have problems getting character set convertion to work in 4.1.4 gamma under linux. Can sombody point me to the online recource other than standard MySQL doc so that I get more information.
6
by: Chiller | last post by:
I'm in the process of writing a class that performs functions on a Distance object. The object is created by entering details as "Distance a (5, km)" or "Distance b (3, cm)" etc. I wish to write...
1
by: Vidar | last post by:
I have a problem in dotNET XSL convertion object. (XMLTRANSFORM) It won't convert UTF-8 to ISO-8859-1 I use this stylesheet for konvertion: <?xml version="1.0" encoding="ISO-8859-1"?> <!--...
4
by: juli | last post by:
Good afternoon! I have an error while trying to convert to DateTime ,here is the code and the error: ArrayList al = new ArrayList(); temp_str=Line.Split(' '); al.Add(temp_str); //...
8
by: juli | last post by:
I am trying to convert an object of a class which is derived from collectionbase class.It's not working: while ((line = file.ReadLine()) != null && line.IndexOf(" ")!=-1) { al.Add(line); }...
0
by: isore | last post by:
Convertion php to asp.net : PB lecture fichier .ini URGENT URGENT URGENT URGENT URGENT URGENT J'ai un code en php (http://parisports.free.fr) mais le client veut le même en asp.net J'ai...
4
by: kaikai | last post by:
Hi, I've got a problem while trying to make my source code clean. In a template: template<typename T> class A { public: T data; };
24
by: ChaosKCW | last post by:
Hi I am reading from an oracle database using cx_Oracle. I am writing to a SQLite database using apsw. The oracle database is returning utf-8 characters for euopean item names, ie special...
7
by: Filips Benoit | last post by:
Dear all, Tables: COMPANY: COM_ID, COM_NAME, ..... PROPERTY: PRP_ID, PRP_NAME, PRP_DATATYPE_ID, PRP_DEFAULT_VALUE ( nvarchar) COMPANY_PROPERTY: CPROP_COM_ID, CPROP_PRP_ID, CPROP_VALUE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
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...
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....

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.