Mail Archives: djgpp/1999/07/24/10:10:40
| From: | Jon DeMarks <whatfor AT mindspring DOT com>
|
| Newsgroups: | comp.os.msdos.djgpp
|
| Subject: | Terminal Programming
|
| Date: | Fri, 23 Jul 1999 19:43:23 -0400
|
| Organization: | Tachyeon Systems
|
| Lines: | 10
|
| Message-ID: | <3798FE1B.AE7EEEC@mindspring.com>
|
| NNTP-Posting-Host: | d1.8a.b2.20
|
| Mime-Version: | 1.0
|
| X-Server-Date: | 23 Jul 1999 23:43:08 GMT
|
| X-Mailer: | Mozilla 4.04 [en] (Win95; U)
|
| To: | djgpp AT delorie DOT com
|
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
| Reply-To: | djgpp AT delorie DOT com
|
I am trying to write a terminal that will get a command typed by the
user and execute a function corresponding to it. Any suggestions? The
following code snippet is stand-alone and can be compiled.
#include <stdio.h>
void _freedbgkern() { char buf[128];
printf("\nFreedows Terminal v.1.0a By Jon DeMarks\n\n");
for(;;) { fflush(stdin); scanf("%s", buf);
if(buf=="sd") { sd(); }
else { printf("Invaild command %s, come again?\n", buf); } } }
- Raw text -