prabuxx said:
can u explain the features of files in c & c++
As it pertains to C, a file is usually a named entity that is connected
to a stream by the use of fopen(), and used to exchange data with the
program's environment. It can also be renamed with rename() and removed
with remove() functions. C defines two types of streams and hence
files: text and binary. A text stream is composed of one or more lines
with each line terminated, as far as C is concerned, with a newline
('\n') character, while a binary stream is merely a sequence of bytes,
with the system doing no special interpretation. When your program
starts-up three predefined file streams are already openend by the
system, viz., stdin, stdout and stderr, which may be connected to
either disk files or other I/O devices.
As you can see, the C concept of "file" is not quite what most people
think of as files (i.e, disk files). A C file is a named entity with
which to read and write data to the program's environment, and managed
with an associated stream.
I believe the essentials of this concept are true for C++ too, though
the API is markedly different and wrapped as objects.