I understand the rules for exporting a d'base table to .csv and there are plenty of links explaining the rules of csv files, including the handling of comma's/quotes etc.
There are probably a myriad of other issues I'll come across in the future that I don't know about. Some of the data I'm exporting contains sql strings with broken up quotes and comma's in between.
I thought it would be a good idea to ask if there exists an open source C++ library specifically for handling this kind of thing. I'll eventually have a foolproof solution of my own built but I can't help thinking that I'm reinventing the wheel.
But if all you are doing is writing a CSV, you only need to know a little about who will be using your file and follow this document religiously: http://creativyst.com/Doc/Articles/CSV/CSV01.htm
To handle the SQL strings, you only need a function that takes any string and properly quotes it for use in the CSV file. (And that's really about the hardest part.)