English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

using the fact that text file contains only ascii charectors

2007-01-20 23:27:03 · 3 answers · asked by Maheedhar 3 in Computers & Internet Programming & Design

3 answers

I don't think that there is a facility in C to determine the type of a file; it simply opens files as streams of generic data. In theory, any file may be represented as a text file, if you consider the fact that hexadecimal bytes are representable in ASCII.

Like the next person said, you should do your own work regarding this matter, but I will give you a tip: it's going to involve reading the entire file and testing each character one-by-one. My advice would be to find, borrow or buy the book "The C Programming Language" (new testament) by Kernighan and Ritchie. It's an indispensable tool for C programming newbies and veterans alike.

2007-01-21 08:01:52 · answer #1 · answered by twelfthdimensiontraveller 1 · 0 0

check the file name extension
txt or not

2007-01-21 08:51:57 · answer #2 · answered by iyiogrenci 6 · 0 1

Do your own home work, or learn how to use Google!

2007-01-21 07:34:06 · answer #3 · answered by toxisoft 4 · 0 0

fedest.com, questions and answers