Chinaunix首页 | 论坛 | 博客
  • 博客访问: 38017
  • 博文数量: 10
  • 博客积分: 236
  • 博客等级: 二等列兵
  • 技术积分: 110
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-20 21:15
文章分类
文章存档

2013年(3)

2012年(7)

我的朋友

分类: LINUX

2012-12-19 20:54:36

#include
//#include
//#include
void
createfile (int *fd)
{
  *fd = creat ("test.txt", 0700);
  printf ("--->%d.\n", *fd);

  if (*fd == -1)
    {
      perror ("创建失败.\n");
      return;
    }
  else
    printf ("创建成功.\n");
   printf ("--->%d.\n", *fd);
}

int
main ()
{
  int fd;
  createfile (&fd);
 
  printf ("--->%d.\n", fd);
  return 0;
}

阅读(1330) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~