I was encountering a code here and I was curious about this passage:
FILE *fp = fopen("Agenda.txt","a+t");
What is "a+t"
?
I was encountering a code here and I was curious about this passage:
FILE *fp = fopen("Agenda.txt","a+t");
What is "a+t"
?
This is the access mode to the file being opened. The "a +" indicates that you can only add data to the end of the file (append ) and can also be read ("+"). Recording must always be made official with fflush()
.
"t" indicates that you can only use text , but this is not C's default Only some specific compiler accepts on specific platform, but this is considered to be an undefined behavior.
According to the fopen .
"a + t" or "at +" it opens a text file in read or update mode (adding the new information at the end of the file).