When i use text files for input and output using fstream filestream, the file extension used is .txt
I have seen people use instead of .txt:
They use .DAT and still they open it in a text editor as if it were a text file.
So is DAT a text file extension and are there what are all the extensions i can use with text files.?
The short answer: text files can have any extension you want, including NO extension. You can take somefile.txt and rename it to somefile.XYZPDQ if you feel like it. It will still be a text file.
That’s from a pure C++ language perspective. At the operating system level, a file extension may be associated with a certain program type (you might have .mp4 videos open in a video player, for example). But you can still call any text file anything you want. Nothing stops you from doing this.