| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have files with many lines of 80 columns of numbers and blanks. I have had little success in extracting integers, floats or doubles from particular columns. This has been tried using text with strings, and binary code. Neither seems to work for me.
It would be appreciated if some good samaritan could point me in the correct direction for dealing with substrings from the original 80 columns of numbers and convert fields into int, float, or double. The latter formats are required for further processing. francis,r |
|
#2
|
|||
|
|||
|
look into the string header, namely the substr() member function of the string class
also look into the cstdlib header, and the functions atoi() and atof() for string: http://www.bgsu.edu/departments/compsci/docs/string.html for cstdlib: http://www.cplusplus.com/ref/cstdlib/ (string is on this site too, but it doesn't list the substr function) |
|
#3
|
|||
|
|||
|
I suggest for MSDN reference. It has good description and illustrations.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > substrings in C++ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|