文件开启关闭操作c语言模板

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
	FILE *fp = NULL;
	fp = fopen("./1.txt", "w+");
	if (fp == NULL) {
		perror("fopen");
		system("pause");
		return -1;

	}




	if (fp != NULL) {
		fclose(fp);
		fp = NULL;
	}
	 





	



	printf("\n");
	system("pause");
	return 0;
}

猜你喜欢

转载自www.cnblogs.com/albertshine/p/13403135.html
今日推荐