xfopen fopen_for_read

#include <stdio.h>
# define FAST_FUNC /* nothing */
FILE* FAST_FUNC fopen_for_read(const char *path)
{
	return fopen(path, "r");
}
FILE* FAST_FUNC xfopen(const char *path, const char *mode)
{
	FILE *fp = fopen(path, mode);
	if (fp == NULL)
		printf("can't open '%s'", path);
	return fp;
}
FILE* FAST_FUNC xfopen_for_read(const char *path)
{
	return xfopen(path, "r");
}
FILE* FAST_FUNC fopen_for_write(const char *path)
{
	return fopen(path, "w");
}

FILE* FAST_FUNC xfopen_for_write(const char *path)
{
	return xfopen(path, "w");
}

int main()
{
  printf("hello,world");
  return 0;
}

  

posted on 2024-04-29 17:51  lydstory  阅读(5)  评论(0编辑  收藏  举报

导航