I have a file full of lines in this format:
1 - 2: 3
I want to only load numbers using C++ streams. Whats the most elegant way to do it? I
Simply,
ifstream file("file.txt"); int n1, n2, n3; char tmp; while (file.good()) { file >> n1 >> tmp >> n2 >> tmp >> n3; }