?? cmd1.c
字號:
#include "apue.h"#define TOK_ADD 5void do_line(char *);void cmd_add(void);int get_token(void);intmain(void){ char line[MAXLINE]; while (fgets(line, MAXLINE, stdin) != NULL) do_line(line); exit(0);}char *tok_ptr; /* global pointer for get_token() */voiddo_line(char *ptr) /* process one line of input */{ int cmd; tok_ptr = ptr; while ((cmd = get_token()) > 0) { switch (cmd) { /* one case for each command */ case TOK_ADD: cmd_add(); break; } }}voidcmd_add(void){ int token; token = get_token(); /* rest of processing for this command */}intget_token(void){ /* fetch next token from line pointed to by tok_ptr */}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -