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不能用??
- #include <stdio.h>
- #include <stdlib.h>
- #define TOK_ADD 5
- #define MAXLINE 1
- void do_line(char *);
- void cmd_add(void);
- int get_token(void);
- int main(void)
- {
- char line[MAXLINE];
- printf("MAXLINE=%d\n",MAXLINE);
- while (fgets(line,MAXLINE,stdin) != NULL)
- do_line(line);
- exit(0);
- }
- char *tok_ptr;
- void do_line(char *ptr)
- {
- int cmd;
- tok_ptr=ptr;
- while((cmd=get_token())>0)
- {
- /*switch(cmd)
- {
- case TOK_ADD:
- cmd_add();
- break;
- }*/
- }
- }
- /*void cmd_add(void)
- {
- int token;
- token=get_token();
- printf("hello cmd_token\n");
- }*/
- int get_token(void)
- {
- /*printf("get_token run\n");
- return 5;*/
- }
阅读(815) | 评论(0) | 转发(0) |