Quantcast
Channel: ...Int to Char
Viewing all articles
Browse latest Browse all 8

...Int to Char

$
0
0
TotoTitus wrote:
> Hello everyone, tried searching, but couldn't find anything working.
> I need to convert a regular int (let's say, 65) to its char representation.
> Problem is, i already tried some solutions, but none worked.
> Here's what i tried:
>
>
> int nr=65;
>
> char c=(char)nr;
> //Doesn't work;
> char c=static_cast<char>(nr);
> //Nay, doesn't work either
Define "doesn't work". How does the result differ from your expectations? Both lines look OK to me.
--
Igor Tandetnik

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>