#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<stdio.h>
void main()
{
int len;
char buffer[512];
FILE *hello_file;
hello_file = fopen("hello.txt","r");
if(NULL == hello_file)
{
printf("sorry\n");
}
else
{
fread(buffer,1,sizeof(*hello_file),hello_file);
printf("%s\n",buffer);
fclose(hello_file);
}
}
以上是有源代码求助大神来回的答
#include<sys/stat.h>
#include<fcntl.h>
#include<stdio.h>
void main()
{
int len;
char buffer[512];
FILE *hello_file;
hello_file = fopen("hello.txt","r");
if(NULL == hello_file)
{
printf("sorry\n");
}
else
{
fread(buffer,1,sizeof(*hello_file),hello_file);
printf("%s\n",buffer);
fclose(hello_file);
}
}
以上是有源代码求助大神来回的答