[Edit]
I'm not sure I'm helping you with this answer, since you didn't provide a problem, you did not say anything about what you tried, and what failed.
You should not expect people to just find a solution to your problem, I was just interested to do it, so I just posted my findings.
But this is not how this forum should work, programming is about learning, and if you just ask without trying nor explaining what your thought process was until now you will not learn.
Anyway, read the answer from which this one is inspired, there are some key elements to learn from.
[/Edit]
This code is inspired by this answer, that should be helpful for you to understand key concepts of C++.
Explanation for the emplace_back vs push_back.
Explanation for the Range-based for loop: "for (auto i : collection)"
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iterator>
#include <cassert>
#include <iostream>
int main()
{
std::vector< std::vector<double> > values;
std::ifstream ifs;
std::string line;
ifs.open("test.txt");
while(getline(ifs,line))
{
std::istringstream is(line);
std::vector<double> ns;
std::copy(std::istream_iterator<double>(is)
, std::istream_iterator<double>()
, std::back_inserter(ns));
assert(ns.size() > 1); //throw something
values.emplace_back(std::vector<double>(ns.begin(), ns.end()));
}
for (auto line : values)
{
for (auto value: line)
{
std::cout << value << " ";
}
std::cout << std::endl;
}
}