www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/29/13:18:10

From: Nicolas Blais <eletech AT netrover DOT com>
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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019