Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Any c++ programmers on here?

Thread Tools
 
Search this Thread
 
Old 02 December 2007, 07:26 PM
  #1  
warrenm2
Scooby Regular
Thread Starter
 
warrenm2's Avatar
 
Join Date: Aug 2003
Location: Epsom
Posts: 5,832
Likes: 0
Received 0 Likes on 0 Posts
Default Any c++ programmers on here?

Trying (unsuccessfully) to write a simple c++ app to read in some data from a csv file into an array of floats, do a few sums on them and output the data.

HOW HARD CAN THIS BE FFS!

Rather than post the code up here, can anyone who can help let me know and I'll do it offline.

Thanks
Old 02 December 2007, 07:36 PM
  #2  
Hanslow
Scooby Regular
 
Hanslow's Avatar
 
Join Date: Mar 2001
Location: Derbyshire
Posts: 4,496
Likes: 0
Received 0 Likes on 0 Posts
Default

Hard to know exactly what you are having a problem with, but make use of the ifstream to read in the csv file in a std::string, then tokenise it by using the comma as a delimeter. Then either dynamically allocate an array, or make use of vectors or other container classes, to store each separate value, and then iterate through the container/array to do whatever you want with the data.

Depends how familiar you are with C++, which compiler and framework you are using, etc.
Old 04 December 2007, 12:10 PM
  #3  
warrenm2
Scooby Regular
Thread Starter
 
warrenm2's Avatar
 
Join Date: Aug 2003
Location: Epsom
Posts: 5,832
Likes: 0
Received 0 Likes on 0 Posts
Default

BIG Thanks to Steve for helping me with my code problem - turns out some dodgy data was responsible.

Steve was really helpful - the power of Scoobynet is amazing
Old 04 December 2007, 12:25 PM
  #4  
Hanslow
Scooby Regular
 
Hanslow's Avatar
 
Join Date: Mar 2001
Location: Derbyshire
Posts: 4,496
Likes: 0
Received 0 Likes on 0 Posts
Default

Happy to help Mark Always good to delve back into code
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM
Alan Jeffery
Non Scooby Related
1
13 September 2015 01:21 PM
Trout
ScoobyNet General
72
30 November 2000 08:23 AM



Quick Reply: Any c++ programmers on here?



All times are GMT +1. The time now is 11:16 PM.