Date: Sat, 20 May 2000 02:58:40 +0100 From: Mark Ovens <mark@ukug.uk.freebsd.org> To: Gustavo Vieira Goncalves Coelho Rios <kernel@tdnet.com.br> Cc: questions@freebsd.org Subject: Re: strange error Message-ID: <20000520025840.B252@parish> In-Reply-To: <3925C207.789AC2AA@tdnet.com.br>; from kernel@tdnet.com.br on Fri, May 19, 2000 at 07:36:55PM -0300 References: <3925C207.789AC2AA@tdnet.com.br>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 19, 2000 at 07:36:55PM -0300, Gustavo Vieira Goncalves Coelho Rios wrote:
> What is the problem with this code. I simply can't figure out:
>
>
> #include <stdio.h>
> #include <string.h>
>
> char *a(char *);
> void t(char *);
>
> /* You should call it with at least one parameters, ex:
> ./a.out test <enter>
> */
>
> void
> main(int argc, char *argv[])
> {
> char *dir;
>
> ++argv;
> printf("%s\n", *argv);
>
> dir = a(*argv);
> t(dir);
>
> printf("%s\n", *dir);
change that to
printf("%s\n", dir);
HTH
> }
>
>
> void
> t(char *a)
> {
> while (*a)
> *a++ = '1';
> }
>
> char *
> a(char *b)
> {
> return strdup(b);
> }
>
> --
> Your mouse has moved.
> Windows NT must be restarted for the change to take effect!
>
> Reboot now? [ OK]
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
--
...and on the eighth day God created UNIX
________________________________________________________________
FreeBSD - The Power To Serve http://www.freebsd.org
My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:mark@ukug.uk.freebsd.org http://www.radan.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000520025840.B252>
