Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Convert a char to an integer

This topic is 5804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
wwhat that guy was doing is typecasting, but i dont understand what the first guy was doing.
is that STL?

<marquee width=100% direction=right><table nostyle="filter:glow(color=red,strength=3)"><table nostyle="filter:shadow(color=blue,direction=left)">Can someone be nice and help me on my way to be the next Hideo Kojima?</table></table></marquee>

Share this post


Link to post
Share on other sites
quote:
Original post by Pipo DeClown
wwhat that guy was doing is typecasting, but i dont understand what the first guy was doing.


That is typecasting as well.
quote:

is that STL?


No, it''s standard C++.

Share this post


Link to post
Share on other sites
Go IndirectX!

<marquee width=100% direction=right><table nostyle="filter:glow(color=red,strength=3)"><table nostyle="filter:shadow(color=blue,direction=left)">Can someone be nice and help me on my way to be the next Hideo Kojima?</table></table></marquee>

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
the guy was probably asking how to parse an int from a char* used as a string.

Share this post


Link to post
Share on other sites
if it is just a single char that is a number and you want an int to be equal to that number

  
char c = ''5'';
int num = c - ''0'';

num is now equal to 5


"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!