如何在C ++中将数据写入Excel文件

如何在C ++中将数据写入Excel文件

问题描述:

我正在使用Microsoft Visual Studio 2012 C ++进行编程. 我的教授要求我将程序的结果放入一个excel文件而不是文本文件中.因为其他人更容易理解. 我可以在C ++程序中使用一些接口来直接生成一个excel文件并将数据放入其中吗?

I am programming with Microsoft Visual studio 2012 C++. My professor asks me to put the result of my program into an excel file instead of a text file. Because it is easier for others to understand. Is there some interface I can use in my C++ program to directly generate an excel file and put the data in it?

如果您不想使用第三方库或自动化工具,并且需要某种格式(颜色,字体等),则可以可以简单地创建一个开放式办公室xml. http://en.wikipedia.org/wiki/Microsoft_Office_2003_XML_formats

If you don't want to use a third party library or automation, and you need some kind of formatting (colors, fonts, etc...) you can simply create a open office xml. http://en.wikipedia.org/wiki/Microsoft_Office_2003_XML_formats