943,692 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 6017
  • C++ RSS
May 16th, 2007
0

how convert int to char?

Expand Post »
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
Similar Threads
Reputation Points: 32
Solved Threads: 4
Practically a Master Poster
jaepi is offline Offline
647 posts
since Jul 2006
May 16th, 2007
0

Re: how convert int to char?

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
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005
May 16th, 2007
0

Re: how convert int to char?

Test the value for 48 ('0') through 57 ('9')
Moderator
Reputation Points: 3278
Solved Threads: 890
Posting Sage
WaltP is offline Offline
7,717 posts
since May 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: void function
Next Thread in C++ Forum Timeline: where should I put my AtlWaitWithMessageLoop(hThread); ??????





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC