work_tmp/read.c

25 lines
481 B
C

#include <stdio.h>
#define READ_PATH "./conf"
#define FILE_NAME "0x1820_0x0000_wash.conf"
int main(void)
{
char path[50];
sprintf(path, "%s/%s", READ_PATH, FILE_NAME);
printf("%s\n", path);
FILE *fp = fopen((const char *)path, "r");
char *read;
if (fp != NULL)
{
do
{
char temp[100];
read = fgets(temp, sizeof(temp), fp);
printf("%s\n", temp);
} while (read != NULL);
}
return 0;
}