View Single Post
Old Apr 9th, 2006, 7:30 PM   #1
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
ascii value to char

Can someone please tell me what's wrong with this code? The array has been declared already. I just don't know how to convert this ascii value to char. if i needed to convert the ascii value to a string I would do:

 int i = 65;
String aChar = new Character((char)i).toString();

// output "a"

However, i need to convert to a char value.

                        int countascii = 65;                        
                        char aChar = ' ';
                        aChar = new Character ((char) countAscii);
                        letters [0] [0] = aChar;
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote