Why . dat and not . txt?

Asked

Viewed 369 times

1

I’m doing a job for my college in C language, it would be basically the entire shoe store system, with file manipulation. Looking for some examples of CRUD on the internet I found several that make use of files .dat, and none that makes use of a .txt.

The .Dat is it better to manipulate the files? Why not txt (all I’ve been taught so far is txt)?

Is there any way I could better visualize what’s written in a file .dat?

1 answer

2


.dat it’s just any name, it indicates nothing about what it has inside, there’s even no specification that says that a .dat should be one way or another, just as a `.txt also does not, although it is customary to use text without any formatting.

They use it to say that there’s data in there, nothing else, every use can be one way. Obviously, something that has binary data (encoded like this, accepting the entire range of a Bute and not just a subset, because technically only text also has a binary form) is more common, whereas a .txt it is expected to have only simple texts.

For you to view can only open in any editor, some will show binary data better than others, but they will be essentially unreadable. Some editors are made to read binaries and have specific tools for this.

Apart from this you can create a code that opens and reads all data freely, ie byte per byte without caring about the content.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.