[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Fwd: Re: Shell-Creation. A simulation Code
On Tue, Aug 22, 2000 at 04:44:33PM +0530, Alex M Alex wrote:
> These are errors I got When I compiled your programm..
> test.c: In function `main':
> test.c:6: `str' undeclared (first use in this function)
> test.c:6: (Each undeclared identifier is reported only once
> test.c:6: for each function it appears in.)
> test.c:10: parse error before `1'
> test.c:3: warning: return type of `main' is not `int'
>
#include<stdio.h>
int main()
{
do {
char *str;
printf("command:>");
gets(str);
if (strcmp(str,"exit")==0)
exit(0);
system(str);
} while 1;
exit(0);
}
This will not give any warning.
Kapil Bhalla