Hi all,
I've just installed the lastest itpp version and I found something odd when reading data from an "it" file.
Basically, running a program like this:
using namespace itpp;
int main(int argc, char *argv[]) { // write data into file it_file my_file1("my_file_name.it"); vec a = "1.0 2.0 3.0 4.0"; my_file1 << Name("a") << a;
// read data from file it_file my_file2("my_file_name.it"); vec b; my_file2 >> Name("a") >> b; std::cout << "a = " << b << std::endl;
return(0);
}
triggers the message
*** Error in ../../itpp/base/itfile.cpp on line 966:Wrong type Aborted
after trying to run line my_file2 >> Name("a") >> b;
any help would be appreciated.
cheers, Ricardo Gandia
Please disregard this thread as I realized how powerfull are the flush() and close() functions. :P
However, I think that there is something wrong with the example in (end of the page) http://itpp.sourceforge.net/latest/users_guide.html#itfile_class
, which didn't work. Thankfully, the example in http://itpp.sourceforge.net/latest/itfile.html works just fine. :)
cheers, ricardo
Log in to post a comment.
Hi all,
I've just installed the lastest itpp version and I found something odd when reading data from an "it" file.
Basically, running a program like this:
include <stdio.h>
include <stdlib.h>
include <itpp/itbase.h>
using namespace itpp;
int main(int argc, char *argv[])
{
// write data into file
it_file my_file1("my_file_name.it");
vec a = "1.0 2.0 3.0 4.0";
my_file1 << Name("a") << a;
// read data from file
it_file my_file2("my_file_name.it");
vec b;
my_file2 >> Name("a") >> b;
std::cout << "a = " << b << std::endl;
}
triggers the message
*** Error in ../../itpp/base/itfile.cpp on line 966:Wrong type
Aborted
after trying to run line
my_file2 >> Name("a") >> b;
any help would be appreciated.
cheers,
Ricardo Gandia
Please disregard this thread as I realized how powerfull are the flush() and close() functions. :P
However, I think that there is something wrong with the example in (end of the page)
http://itpp.sourceforge.net/latest/users_guide.html#itfile_class
, which didn't work. Thankfully, the example in
http://itpp.sourceforge.net/latest/itfile.html
works just fine. :)
cheers,
ricardo