Function to convert integer to single char.

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

Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Function to convert integer to single char.

 
0
  #11
Jan 21st, 2008
In case you didn't notice, the fellow wanted the code in C.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Function to convert integer to single char.

 
0
  #12
Jan 21st, 2008
> In case you didn't notice, the fellow wanted the code in C.
He also wanted it 3 YEARS ago as well.

Not only late, and in the wrong language, it's also old C++, and non-portable.
Use '0', not 48 (like was used oh so long ago in a galaxy far far away).
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: themoon49 is an unknown quantity at this point 
Solved Threads: 0
themoon49 themoon49 is offline Offline
Newbie Poster

Help me

 
0
  #13
Oct 27th, 2009
hello dear brothers
the following program is not real result for me
please explain me
thanks a lot



#include<iostream.h>
int main ()
{
int a;

cout<<"enter nnumber";
cin>>a;

char x;
x=a+48;
cout<<x<<endl;

return 0;
}
Reply With Quote Quick reply to this message  
Reply

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




Views: 47842 | Replies: 12
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC