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

How to change ASCII to Alphabet.

i wonder how to change a number to alphabet. like ASCII to alphabet.

Expand|Select|Wrap|Line Numbers
  1.  
  2. int main()
  3.  
  4. int i;
  5. char c;
  6.  
  7. cout<<"write a while number"<<endl;
  8. cin>>i;
  9. c=i;
  10. cout<< c <<endl;
  11.  
  12. like this looks my code but it does not function properly as it should be.
  13.  
  14.  
  15.  
Sep 18 '10 #1
3 3004
weaknessforcats
9,208 Expert Mod 8TB
Well, if a char has a value of 'A', then if you assign the char to an int you can see the value of the int.

If you do this backwards, you have converted an int to a member of the alphabet.
Sep 18 '10 #2
donbock
2,426 Expert 2GB
@encryptor: I don't understand what you want to do. Please provide a simple example showing an input value and a corresponding output value.
Sep 19 '10 #3
Your code set value to i from input (cin).

If you enter 65, and then set c = i, c holds 65 witch interprets as 'A' as character. "cout'ed" this gives "A" (as long as your PC does not have a very very strange coding table).

Execution would be:
Expand|Select|Wrap|Line Numbers
  1. write a while number
  2. 88<enter>
  3. X
  4.  
  5. or
  6.  
  7. write a while number
  8. 65<enter>
  9. A
  10.  
  11. and so on.
  12.  
Sep 19 '10 #4

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

Similar topics

4
by: Arne Hendrickson | last post by:
Can anyone tell me how to edit this script for "traditional frames" to work with iframes? SCRIPT language="JavaScript"> <!----hide function change2() { parent.left_frame.location="page3.htm";...
0
by: temp | last post by:
Hi, I'm not good in regexp. TEXT: <a href="index.php">asasa</a> <a taget href='index.php'>asasas</a> I want to change only "index.php" in all occurance in a link tag.
2
by: Larry C | last post by:
Hello, I have an XML doc and I am trying to write a utility thath will allow me to change a particular word with my "title" section of theXML doc. I would like to look for a "word" in the title...
1
by: mrwoopey | last post by:
I have a repeater control in a asp.net app. Once the repeater is fill with data (via bind) I would like to go through the repeater and change the color of one of the items. I can get to where the...
1
by: finekey | last post by:
I build a webpage with two frames(contents and main), I build a aspx in main frame, which has a Button webcontrol, the problem is that :how can I change webpage in contents frame when the...
3
by: ciffycyclops | last post by:
Hi i have written a vbscript to manage permanent event consumer classes of wmi .. here i used the NTEventLogEventConsumer class to store the specific event notification in the windows event...
1
by: iniyan | last post by:
i want to display data into graph and chart using asp but not sure how to do it.i want to retrieve the data from mysql.
3
by: Jiwei06xie | last post by:
Dear expert, I got two forms. form1: Combox form Form_rptStock (key field: serial number), with one command button. form2: Entryform Entryform_stock, with a series of command buttons. I use...
18
by: wizdom | last post by:
Help - change text on click - text has another onclick inside with php variables ---------- I think what I'm trying to do is simple. I have a 2 buttons on a page. 1 button allows a thread of...
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...
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
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...
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...

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.