What is the difference between file stream in C and iostream in C ++?

What is the difference between file stream (File * pointer) in C and iostream in C ++?

Why are they called a stream, do they have something in common?

+3
source share
7 answers

Both deal with files, and “stream” is just a very general term for data that comes from separate sources.

The main difference is that the C ++ C ++ i ++ objects are classes / objects, and the C files are accessed through certain f * () functions.

So basically the same task, a different interface style.

+9
source

, , /, , 1:1, I/O (, ).

, fread() 2 1024 , , , 57, . , 2 , 55 . , , .

EDIT: , (stderr cerr, ) . , . printf() .

+5

, ++.

http://accu.org/index.php/journals/1539

:

  • FILE
  • ::
  • Boost.Format
  • FastFormat ( , Imperfect ++.)
+3

/ .

+2

++ : C :

  • .
  • , .
+1

C Java

0

, , : (), .

, . , , ( ), . , , seek() , .

, ReadLine(), WriteLine(), ( ). .

-1

Source: https://habr.com/ru/post/1704954/


All Articles