Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Read a text file and assign values to variables int and double
Read a text file and assign values to variables int and double [message #46495] Mon, 16 May 2016 10:41 Go to previous message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

Let's imagine that we have a text file with the following format:

1 ____ 100.00
2 ____ 200.00
3 ____ 300.00
.....
There is blank space (represented by the underscores) between the integer numbers in the first column and the double numbers in the second column. Is there any way of opening such a text file and assigning the values to a U++ Vector<int> and Vector<double> containers? In standard C++ (using C++ streams and operator >>) this is simple but how can it be done using U++ Streams (FileIn)? do I have to overload operator >>? is there any simple way of doing it?

Many thanks,

Javier
 
Read Message
Read Message
Previous Topic: Pre processor and macro error
Next Topic: Capture division by zero
Goto Forum:
  


Current Time: Tue Apr 16 23:45:19 CEST 2024

Total time taken to generate the page: 0.02206 seconds