C ++中的文件打开模式

编程入门 行业动态 更新时间:2024-10-26 16:35:45
本文介绍了C ++中的文件打开模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以在二进制模式下使用C ++中的open()函数打开.xls或.PDF文件吗?如果没有,我该如何构建一个应用程序,以读取具有这种文件格式(甚至更多)的文件内容

Can I open a .xls or .PDF file using the open() function in C++ with binary mode and read its contents? If not, how can I build an application program that can read the contents of files with such file formats (and maybe more)

推荐答案

是的,您可以将文件系统中的任何文件作为二进制文件打开,也可以读取(只要您的操作系统允许基于文件访问权限打开文件,并且没有其他应用程序被锁定)等等)。

Yes, you can open any file in your filesystem as a binary file, and you can read it too (as long as your operating system allows the file to be opened based on file access rights, and no other application has got a lock on it, etc).

接下来,您可能会问如何解释PDF或XLS文件?正如他们在英格兰所说的那样,那是另外一锅鱼。 PDF和XLS文件都不是直接理解的。我最近查看的PDF librar包含几十个文件,并且源代码为几兆字节。我使用Python处理XLS文件,并且其中的代码有几千行。

Next you'll probably ask "How do I interpret a PDF or XLS file?" and that's a whole other kettle of fish as they say here in England. Neither PDF, nor XLS files are straight forward to "understand". A PDF librar that I looked at recently contains several dozen files, and is several megabytes of source code. I've worked with XLS files in Python, and the code there was a few thousand lines of code.

更多推荐

C ++中的文件打开模式

本文发布于:2023-10-08 13:57:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472832.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模式   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!