Can we open .pdf or .doc from C++ using fstream? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Can we open .pdf or .doc from C++ using fstream?

I am creating a project for an airline reservation using C++. I created a function to print a passengers ticket, save it in a .txt or.htm file for viewing and change details later whenever needed... But now, I thought It would be better to save such documents in a .doc or .pdf file... So, can I open these files in the same way as the text files? Are they accessible like normal .txt,.bin or .htm files?

11th May 2017, 1:02 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
2 Answers
+ 3
No, C++ only allows .txt files to be opened.
11th May 2017, 3:58 PM
HaxterHuz
HaxterHuz - avatar
11th May 2017, 4:05 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar