Subj : Re: directly inputting numbers To : borland.public.cpp.borlandcpp From : maeder@glue.ch (Thomas Maeder [TeamB]) Date : Fri Jul 18 2003 08:56 pm "Michael Fruchter" writes: > How will the program know where the number ends? I'm dealing > with a text that has many numbers that are not delimited (e.g. by spaces) > but are of fixed width. I was hoping that it's > possible to specify the amount of characters that you want to > read into your integer (analogous to fgets with strings). I didn't understand that part of your question. Read characters using the read member function of ifstream into a character array. Then create a std::istringstream or a std::istrstream over that array and use it to extract the number. .