Convert from int to char
- From: "Mocha_Java" <theprofessorenator@xxxxxxxxx>
- Date: 25 Sep 2006 13:20:00 -0700
Okay, so i have a dilemma. I have a int variable called rank that
stores integers (obviously). however, i need to display these values as
chars in another method. casting dosent help because it just converts
the integer into the unicode character which isn't the same as the
number.
heres a snippet of the problem:
char r; // as you can see, its gets pretty
repetitive and boring
if (rank == 2)
r = '2';
if (rank == 3)
r = '3';
if (rank == 4)
r = '4';
.....
return r;
is there a trick to make my int number the equivalent char number?
.
- Follow-Ups:
- Re: Convert from int to char
- From: Tor Iver Wilhelmsen
- Re: Convert from int to char
- From: Jeff
- Re: Convert from int to char
- From: IchBin
- Re: Convert from int to char
- From: Patricia Shanahan
- Re: Convert from int to char
- Prev by Date: Re: Displaying time taken to get Results from MySQL Database
- Next by Date: Re: How to drop this exception?
- Previous by thread: Displaying time taken to get Results from MySQL Database
- Next by thread: Re: Convert from int to char
- Index(es):
Relevant Pages
|