Pretty self-explanatory, I tried google and got a lot of the dreaded expertsexchange, I searched here as well to no avail. An online tutorial or example would be best. Thanks guys.
Pretty self-explanatory, I tried google and got a lot of the dreaded expertsexchange, I
Share
If what you’re really doing is manipulating a CSV file itself, Nelson’s answer makes sense. However, my suspicion is that the CSV is simply an artifact of the problem you’re solving. In C++, that probably means you have something like this as your data model:
Thus, when you’re working with a collection of data, it makes sense to have
std::vector<Customer>orstd::set<Customer>.With that in mind, think of your CSV handling as two operations:
Read and write a single row at a time, rather than keeping a complete in-memory representation of the file itself. There are a few obvious benefits:
<table>rendering.sizeof(Customer)vs. the number of bytes in a single row).CSVReaderandCSVWritercan be reused as the basis for an in-memory model (such as Nelson’s) without loss of performance or functionality. The converse is not true.