Chinaunix首页 | 论坛 | 博客
  • 博客访问: 824892
  • 博文数量: 109
  • 博客积分: 650
  • 博客等级: 上士
  • 技术积分: 1483
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-01 17:29
文章分类

全部博文(109)

文章存档

2016年(5)

2015年(21)

2014年(16)

2013年(38)

2012年(29)

分类: 系统运维

2012-05-02 14:38:48

1,warning incompatible implicit declaration of built-in function ‘exit’
纠错:
确认调用exit函数的文件引用了头文件 #include
notic;_Exit,exit为
      _exit为
2,'system' was not declared in this scope
纠错:确认调用System的头文件#include
notice:pause在unix不能用??
 

点击(此处)折叠或打开

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define TOK_ADD 5
  4. #define MAXLINE 1
  5. void do_line(char *);
  6. void cmd_add(void);
  7. int get_token(void);
  8. int main(void)
  9. {
  10.         char line[MAXLINE];
  11.         printf("MAXLINE=%d\n",MAXLINE);
  12.         while (fgets(line,MAXLINE,stdin) != NULL)
  13.                 do_line(line);
  14.         exit(0);
  15. }

  16. char *tok_ptr;
  17. void do_line(char *ptr)
  18. {
  19.         int cmd;
  20.         tok_ptr=ptr;
  21.         while((cmd=get_token())>0)
  22.         {
  23.                 /*switch(cmd)
  24.                 {
  25.                 case TOK_ADD:
  26.                         cmd_add();
  27.                         break;
  28.                 }*/
  29.         }
  30. }
  31. /*void cmd_add(void)
  32. {
  33.         int token;
  34.         token=get_token();
  35.         printf("hello cmd_token\n");
  36. }*/
  37. int get_token(void)
  38. {
  39.         /*printf("get_token run\n");
  40.         return 5;*/
  41. }

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