473,729 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to find the cost to convert 1 string into another (find bit difference using xor)

nabh4u
62 New Member
hi friends,

i have a probelm with finding the bit difference using xor. i have 2 strings and i have to convert the first tring into another. in order to convert i should get the cost by finding the bit difference when comparing 2 characters of the strings. i am trying to use xor but m not getting success....
please suggest me with a sample code as to how to use xor.

thanking you,
Nabh.
Apr 15 '07 #1
2 1645
bluesteel
84 New Member
hi friends,

i have a probelm with finding the bit difference using xor. i have 2 strings and i have to convert the first tring into another. in order to convert i should get the cost by finding the bit difference when comparing 2 characters of the strings. i am trying to use xor but m not getting success....
please suggest me with a sample code as to how to use xor.

thanking you,
Nabh.
Write what you have done and you will surely get a reply
Apr 18 '07 #2
JosAH
11,448 Recognized Expert MVP
hi friends,

i have a probelm with finding the bit difference using xor. i have 2 strings and i have to convert the first tring into another. in order to convert i should get the cost by finding the bit difference when comparing 2 characters of the strings. i am trying to use xor but m not getting success....
please suggest me with a sample code as to how to use xor.

thanking you,
Nabh.
I don't understand how a 'xor' operation can change one string to another one
unless both strings have equal length. If that is so, there's not much 'cost' to
calculate, i.e. you just change the different characters using that 'xor' thing.

If both strings *don't* have an equal length then I don't understand your question.

Care to elaborate?

kind regards,

Jos

ps. or are you 'xoring' the trailing '\0' byte too?
Apr 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
13283
by: snacktime | last post by:
I need to calculate the lrc of a string using an exclusive or on each byte in the string. How would I do this in python? Chris
3
3594
by: Dan | last post by:
I am a relatively new user on Oracle 9.2.0.1 and I am having trouble performance tuning this production database. I am running a large query that joins two tables, document(3 mil) and entity(9 mil). I have reorganized my tablespaces so that the two tables are on different tablespaces, different disks. They both have their indexes stored on a third tablespace. Before reconfiguring the production database, I was getting a range scan on...
2
1290
by: Phil.Latio | last post by:
I'm trying to write a function to achieve the following; Some bright spark thought it would be a good idea to have a report that has the cost price masked with the first 10 letters of the alphabet - sometimes these reports are used in front of our customers and our guy needs to know the cost-price without the customer being aware of it. So 200 would read AJJ, 350 would read CEJ etc
24
3275
by: Sathyaish | last post by:
This one question is asked modally in most Microsoft interviews. I started to contemplate various implementations for it. This was what I got. #include <stdio.h> #include <stdlib.h> #include <string.h> char* StrReverse(char*);
14
7694
by: msnews.microsoft.com | last post by:
How can I encrypt and decrypt string?
5
18720
by: simon | last post by:
I have datetime variable: Datetime tsEndTime; Should I use (DateTime): tsEndTime=(DateTime)rdr.GetValue(15) or is better to use: tsEndTime=Convert.ToDateTime(rdr.GetValue(15))
2
3505
by: Mel Weaver | last post by:
Hello, I'm trying to convert these to functions to c# const C1 = 52845; C2 = 22719; function Encrypt(const S: String; Key: Word): String; var I: byte;
65
21446
by: kyle.tk | last post by:
I am trying to write a function to convert an ipv4 address that is held in the string char *ip to its long value equivalent. Here is what I have right now, but I can't seem to get it to work. #include <string.h> #include <stdio.h> /* Convert an ipv4 address to long integer */ /* "192.168.1.1" --> 3232235777 */ unsigned long iptol(char *ip){
29
5084
by: Harlin Seritt | last post by:
Hi... I would like to take a string like 'supercalifragilisticexpialidocius' and write it to a file in binary forms -- this way a user cannot read the string in case they were try to open in something like ascii text editor. I'd also like to be able to read the binary formed data back into string format so that it shows the original value. Is there any way to do this in Python? Thanks!
0
8921
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8763
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.