- 常见C语言的文件读写方式
fopen("*.*","r")
fopen("*.*","r+")
fopen("*.*","rb")
fopen("*.*","rb+")
fopen("*.*","w")
fopen("*.*","w+")
fopen("*.*","wb")
fopen("*.*","wb+")
fopen("*.*","a")
fopen("*.*","a+")
fopen("*.*","ab")
fopen("*.*","ab+")
注释:逗号右边的引号里r表示只读,w只写(会覆盖原内容,如果以前已经存过该文件),a追加,带b的表示以二进制形式读(写),带+的表示可读可写,比如r为只读,r+就是读写。
时间: 2024-12-20 22:24:32