1. 程式人生 > >file檔案的讀寫

file檔案的讀寫

#include "stdafx.h"
#include "stdio.h"
#include "iostream"
int _tmain(int argc, _TCHAR* argv[])
{
	int count = 0;
	while(count<1000)
	{
		FILE *fp = NULL;
		fp = fopen("PATH.txt","a+");
		if(fp == NULL)
		{
			int error = -9999;
			std::cout<<"errno is "<<errno;
		}
		fprintf(fp,"%s\n","12342412");
		count++;
		fclose(fp);
		fp = NULL;
	}
	system("pause");
	return 0;
}