U++ framework
Do not panic. Ask here before giving up.

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: 272
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: Wed Jun 03 06:03:49 GMT+2 2026

Total time taken to generate the page: 0.00527 seconds