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
281264 is currently offline  281264
Messages: 264
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
Previous Topic: error in examples
Goto Forum:
  


Current Time: Fri May 26 18:59:30 CEST 2017

Total time taken to generate the page: 0.00747 seconds