Source File: ex20_v1_v2.diff
--- ex20_v1.cpp 2026-04-12 10:36:26.108174362 -0400
+++ ex20_v2.cpp 2026-04-12 10:36:49.666521626 -0400
@@ -3,7 +3,7 @@
#include <vector>
using std::vector, std::string, std::ifstream, std::ios;
-using fmt::println;
+using fmt::println, fmt::print;
int chunk_number(const string& line, size_t start, size_t end) {
string chunk = line.substr(start, end - start);
@@ -33,6 +33,7 @@
int main(int argc, char* argv[]) {
string filename{argv[1]};
ifstream in_file(filename, std::ios::binary);
+ vector<vector<int>> table;
if(!in_file.is_open()) {
println("failed to open {}", filename);
@@ -47,9 +48,14 @@
if(line == "") break;
vector<int> row = parse_line(line);
+ table.push_back(row);
+ }
+ for(vector<int> row : table) {
for(int cell : row) {
- println("number: {}", cell);
+ print("{}\t", cell);
}
+
+ print("\n");
}
}