converting a char array to integer

  • giraffes4
  • Born
  • Born
  • No Avatar
  • Joined: Feb 14, 2004
  • Posts: 1
  • Status: Offline

Post February 14th, 2004, 12:15 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 14th, 2004, 12:15 pm

  • JohnDeW
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 9
  • Status: Offline

Post February 16th, 2004, 6:54 pm

try cint? what language?
  • JohnDeW
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 9
  • Status: Offline

Post February 16th, 2004, 7:01 pm

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
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 9
  • Status: Offline

Post February 16th, 2004, 7:09 pm

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 279 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.