Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

ビジュアルスタジオ用

#include <stdio.h>
#pragma warning(disable: 4996)
int main(void)
{
	FILE* fp;
	char* fname = "log.txt";
	char* str = "aaa";
	int i;
	fp = fopen(fname, "a+");
	if (fp == NULL) {
		printf("%sファイルが開けません?n", fname);
		return -1;
	}
	for (i = 0; i < 3; i++) {
		fputc(str[i], fp);
	}
	int var = 30;
	fclose(fp);
	printf("%sファイル書き込みが終わりました?n", fname);
	return 0;
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.