#include
"stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#define DATAFILE "../web/data.txt"
int main(
void)
{
FILE *f = fopen(DATAFILE,
"r");
int ch;
if(f ==
NULL) {
printf("%s%c%c\n",
"Content-Type:text/html;charset=iso-8859-1",
13,
10);
printf("<TITLE>Failure</TITLE>\n");
printf("<P><EM>Unable to open data file, sorry!</EM>"); }
else {
printf("%s%c%c\n",
"Content-Type:text/plain;charset=iso-8859-1",
13,
10);
while((ch=getc(f)) !=
EOF)
putchar(ch);
fclose(f); }
return 0;
}
View Code
读文件
转载于:https://www.cnblogs.com/https/p/10781671.html
相关资源:TCPIP协议完整版
转载请注明原文地址: https://win8.8miu.com/read-1560523.html