Helpful Information
 
 
Category: C Programming
changing type int/double to type char

hey...this could be a real easy question.

How can you change a type int or double to a type char? I need to be able to pass the number to a string so as it prints out the number, not the digits code in ascii.

you want to make a string (char[] or char* ) of a number, not a char, right? use sprintf()

You can also static_cast the var....
charVar = static_cast<char>intVar

~Trex~










privacy (GDPR)