Jump to content

Data type conversions?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Macoder

Macoder

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
I would like a way to convert different data types into one another. Right now all I need is int to string (as defined in genlib and simpio), but I would like other conversions because I expect to be using them a lot in the future. Does anyone know of a command to do this, or a library I can include that has a conversion function?

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
Easiest way is scanf

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The boost library has a type conversion library.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Not for C...
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#5
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts
use atoi() from stdlib.h

#6
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts

TkTech said:

Easiest way is scanf
...

#7
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

TkTech said:

...

Yea, i know, it was a strange answer...