From: Jon DeMarks Newsgroups: comp.os.msdos.djgpp Subject: Re: Terminal Programming Date: Fri, 23 Jul 1999 23:38:06 -0400 Organization: Tachyeon Systems Lines: 18 Message-ID: <3799351D.FC119898@mindspring.com> References: <3798FE1B DOT AE7EEEC AT mindspring DOT com> NNTP-Posting-Host: d1.8a.07.79 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 24 Jul 1999 03:36:58 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 Jon DeMarks wrote: > 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 > 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); } } } answering my own question here, but it might help somebody out: use: if(strcmp(buf,"sd") { sd(); } instead of: if(buf=="sd") { sd(); }