Vấn đề về dùng r+ khi mở file

chắc là do trước lúc đấy e chạy mấy cái code ngu ngu vào cái file đấy nên vậy, e cũng toàn chạy ra đúng quy trình mà có mỗi lần bị thôi à. thôi kệ nó đi, cảm ơn a đã giúp e nha <3

1 Like

Có khi ghi rồi mà ko flush rồi lại đọc lên thì undefined luôn ấy chứ :smiley:

C99 N1256 7.19.5.3, 6

When a file is opened with update mode (’+’ as the second or third character in the
above list of mode argument values), both input and output may be performed on the
associated stream. However, output shall not be directly followed by input without an
intervening call to the fflush function or to a file positioning function (fseek,
fsetpos, or rewind), and input shall not be directly followed by output without an
intervening call to a file positioning function, unless the input operation encounters end of-file.

5 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?