This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Ascii to Decimal - Eating my Brain. Urgent please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Ascii to Decimal - Eating my Brain. Urgent please" Watch "Ascii to Decimal - Eating my Brain. Urgent please" New topic
Author

Ascii to Decimal - Eating my Brain. Urgent please

Rajesh Kumar
Greenhorn

Joined: Nov 16, 2001
Posts: 28
Dear Friends
I am facing pblm while converting ascii to dec.
at present my program is supporting to this..
ascii dec
a 61
but, when i give "aa" it is still saying 61 as decimal.
how can i make my program to get this type of result
aa 6161
aaa 616161
is it possible.
please help me.
Thanks in advance
Yours
Rajesh
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4456
    
    6

Based on the information you have given, you are doing two things wrong:
1. ASCII('a') is 97, not 61
2. You don't have a loop to process each character in a string
Post some code and we'll tell you exactly where you're doing it wrong (and don't forget to use the little Instant UBB Code "Code" button below the "Add Reply" button when you reply)


Junilu - [How to Ask Questions] [How to Answer Questions]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Ascii to Decimal - Eating my Brain. Urgent please