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

how to translate words into number?

10
how to tranlate words(string) to number?
for example,
char string[]="abcd"
my output will show "abcd is 1234"
Aug 28 '07 #1
5 1938
gpraghuram
1,275 Expert 1GB
how to tranlate words(string) to number?
for example,
char string[]="abcd"
my output will show "abcd is 1234"
I assume u want to convert 1->1,b->2....e-5 ......z-26.
If u want to do this then u shuld have a mapping table holding the position and the character.
Then have u tried anything on this.

NOTE:Please dont double post.


Raghuram
Aug 28 '07 #2
rhitam30111985
112 100+
here we go:
::Spoonfeeding code does not help the OP learn, and was snipped::
:-)
Aug 28 '07 #3
dmjpro
2,476 2GB
I assume u want to convert 1->1,b->2....e-5 ......z-26.
If u want to do this then u shuld have a mapping table holding the position and the character.
Then have u tried anything on this.

NOTE:Please dont double post.


Raghuram
If gpraghuram assumption is right then the following code will be helpful rather then making a Map Table.

Expand|Select|Wrap|Line Numbers
  1. char strings[] = "abcd...xyz";
  2. for(int i=0;strings[i]!='\0';i++) cout<<strings[i]-96;
  3.  
Try this it will be helpful.
I here did the Arithmetic Operation on Character.
Wish you a best of luck with your try.

Kind regards,
Dmjpro.
Aug 28 '07 #4
rhitam30111985
112 100+
oops!! ... wrong syntax.. got confused a little.. sorrry
rhitam
Aug 28 '07 #5
sicarie
4,677 Expert Mod 4TB
oops!! ... wrong syntax.. got confused a little.. sorrry
rhitam
rhitam-

Please look at and respond to your PM (Private Messages) located in the top right corner of the page.

Thanks
Aug 28 '07 #6

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

Similar topics

1
by: Joe | last post by:
Hi all Is there a TSQL function like Oracle's Translate function? Where: Translate('13,000 Miles','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ, ',' ') would return '13000'? I'm...
15
by: jiverbean | last post by:
Dear group members, I cam across a glitch in Javascript and I don't know how to solve it elegantly. I have an array with strings of German words: profile = "Fröhliches Fräulein"; Because...
6
by: VBTricks.de.vu Webmaster | last post by:
Hello, in VB6 I used to translate my application by setting the tag-property of all controls, menu-entries... to a number which has been linked to a string (array). Then I went through all...
0
by: Lildog | last post by:
I use this code to generate random names for jewelry products I will eventually sell. I found this code on the web and wondered if someone could give a detailed description of each line of code? I...
7
by: Jay | last post by:
How would I be able to grab random words from an internet source. I'd like to grab a random word from a comprehensive internet dictionary. What would be the best source and the best way to go...
8
by: shapper | last post by:
Hello, I have a string which holds a text. Is it possible to create a substring which uses the first N words of that string? Thanks, Miguel
1
by: isaac86 | last post by:
words translate into phone numbers
4
by: kovariadam | last post by:
Hi, Does anybody know why i get this error: SQL0176N The second, third or fourth argument of the TRANSLATE scalar function is incorrect. SQLSTATE=42815 with this query: SELECT...
1
by: fifou92 | last post by:
Hi, I would like to translate (Encrypte) a code from a variable. This code is made of 3 numbers and substitution must respect a rule according number position. For exemple: If number 1 is the...
2
by: alwaali | last post by:
Hi I need help please This is my project and i need a help to solve it with you A page of text is to be read and analyzed to determine number of occurrences and locations of different words. The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.