From: Nicolas Blais Newsgroups: comp.os.msdos.djgpp Subject: Why won't this work? Date: Sun, 29 Mar 1998 13:00:07 -0500 Organization: Elemental Technologies Lines: 18 Message-ID: <351E8C26.2608F112@netrover.com> NNTP-Posting-Host: 198.168.87.8 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, Check the code below, can't figure out why this doesn't work, I mean, should it exit when I enter exit? Also, when I type spaces into my string, it creates as many ":" as I inputed spaces. Can anyone fix this? getcommand(void) { char *p; char *com; for (p = ":"; *p;p++) put_char(*p, 10); scanf("%s",com); if (strcmp(com, "exit") == 0) exit(0); getcommand(); return 1; }