converting a char array to integer

  • giraffes4
  • Born
  • Born
  • giraffes4
  • Posts: 1

Post 3+ Months Ago

Right now I have an input file being read into a char array via the getline statement. After this is done I want to make the char values in the array equal to the integers they are. I know every char in the file im reading in is an integer, but atoi does not work. Any suggestions would be greatly appreciated.
Thanks.

Kevin
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • JohnDeW
  • Newbie
  • Newbie
  • JohnDeW
  • Posts: 9

Post 3+ Months Ago

try cint? what language?
  • JohnDeW
  • Newbie
  • Newbie
  • JohnDeW
  • Posts: 9

Post 3+ Months Ago

It sound like C.. is that correct?

Is the input file a text file? (is it readable in Notepad, or does it look like garbage symbols?) Can you show the code that you are using to open and read the file? Can you please describe the progm... the reason you are writing it and the overall goal of this program? Thanks!
  • JohnDeW
  • Newbie
  • Newbie
  • JohnDeW
  • Posts: 9

Post 3+ Months Ago

delphi: integer()
vbscript: CInt
c: wcstol() (wide character string to int)
c: atoi('1600080001'): (10 digits)
c: atoll('16000800008800008965'): (20 digits)
c: atof('109.623') floting point

and these dont work? code please.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 35 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.