Results 1 to 8 of 8
Thread: how do I find acsii character?
- 10-28-2010, 08:37 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 10
- Rep Power
- 0
- 10-28-2010, 08:43 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 787
- Rep Power
- 11
e.g. here:ASCII-Table
33-126
but you do not need to know them, you could use char instead of int in a for loop :rolleyes:
- 10-28-2010, 08:54 PM #3
Member
- Join Date
- Oct 2010
- Posts
- 10
- Rep Power
- 0
/*(Displaying the ACSII character table) Write a program that
prints the characters in the ASCII character table
from '!' to '~'. Print ten characters per line. */
- 10-28-2010, 09:02 PM #4
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 787
- Rep Power
- 11
yes and what is your question now? for the ten characters per line you could use modulus (%)
- 10-28-2010, 09:50 PM #5
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 17
you could use char instead of int in a for loop
and, in case you hadn't reaslised it, you can use the character constants in the for loop:
Java Code:for(char ndx='!'; ndx <= '~'; ndx++)
You will have to use a little imagination to get the % operator to detect every 10th character.
- 10-28-2010, 10:04 PM #6
Member
- Join Date
- Oct 2010
- Posts
- 10
- Rep Power
- 0
I cant do it.(Print ten characters per line):S:(
- 10-28-2010, 10:18 PM #7
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 10
- 10-29-2010, 07:46 AM #8
Similar Threads
-
Convert integers into ACSII characters.
By Valkyrie in forum New To JavaReplies: 4Last Post: 11-24-2009, 03:39 AM -
How to check if character is 7 bit or 16 bit?
By markthien in forum Advanced JavaReplies: 2Last Post: 07-29-2009, 09:26 AM -
Read from a certain character to a certain character
By blackstormattack in forum New To JavaReplies: 0Last Post: 03-16-2009, 12:36 PM -
Character Object
By Java Tip in forum Java TipReplies: 0Last Post: 12-07-2007, 01:04 PM -
reading text character by character
By bugger in forum New To JavaReplies: 2Last Post: 11-09-2007, 09:54 PM
Bookmarks