how convert int to char?

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2006
Posts: 647
Reputation: jaepi is an unknown quantity at this point 
Solved Threads: 4
jaepi's Avatar
jaepi jaepi is offline Offline
Practically a Master Poster

how convert int to char?

 
0
  #1
May 16th, 2007
hello there, in what way you can convert an integer to a char??
i'll use it to check if the user's input is a number, if it is a letter, it will allert him to try again and input a number...the integer will then be use for a 'for loop...thanks
Retreat!!!
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 275
Reputation: andor has a spectacular aura about andor has a spectacular aura about andor has a spectacular aura about 
Solved Threads: 29
andor's Avatar
andor andor is offline Offline
Posting Whiz in Training

Re: how convert int to char?

 
0
  #2
May 16th, 2007
Your problem is not to convert int to char if I'm correct. You only need to check the input with

int isdigit(int character);

link
If you want to win, you must not loose (Alan Ford)
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,131
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 283
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: how convert int to char?

 
0
  #3
May 16th, 2007
Test the value for 48 ('0') through 57 ('9')
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 5403 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC