C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 3rd, 2005, 03:22 PM
francis, r. francis, r. is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 francis, r. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m
Reputation Power: 0
Angry substrings in C++

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

Reply With Quote
  #2  
Old April 4th, 2005, 04:15 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
Send a message via AIM to ubergeek
Arrow

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)

Reply With Quote
  #3  
Old April 5th, 2005, 01:00 AM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 276 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 48 m 58 sec
Reputation Power: 4
I suggest for MSDN reference. It has good description and illustrations.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > substrings in C++


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT