I have a 2D array with generated doubles. I need to write this array to a CSV file so that I can open it in Excel. Is there a method or function in C++ that allows for this to be done? I could do it manually, but it would take a lot longer. Any help is appreciated, thanks.
TheNNS
112
Nearly a Posting Virtuoso
Recommended Answers
Jump to PostTraverse the array and write that in a text file with extension .csv
Write your 2d array entries in comma separated form ending with newline character.
for examplecout<<TestArray[0][0]<<","<<TestArray[0][1]<<newline; cout<<TestArray[0][0]<<","<<TestArray[0][1]<<newline;
I have provided just the format for you, for above task you can iterate complete array …
All 3 Replies
TheNNS
112
Nearly a Posting Virtuoso
tajendra
9
Junior Poster in Training
TheNNS
112
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.