From owner-freebsd-questions Mon Apr 23 10:18:29 2001 Delivered-To: freebsd-questions@freebsd.org Received: from fep04-svc.mail.telepac.pt (fep04-svc.mail.telepac.pt [194.65.5.203]) by hub.freebsd.org (Postfix) with ESMTP id EF52E37B424 for ; Mon, 23 Apr 2001 10:18:23 -0700 (PDT) (envelope-from david@angra.uac.pt) Received: from david ([212.55.178.41]) by fep04-svc.mail.telepac.pt (InterMail vM.4.01.02.27 201-229-119-110) with SMTP id <20010423172559.FYBT5623.fep04-svc.mail.telepac.pt@david> for ; Mon, 23 Apr 2001 18:25:59 +0100 From: David Reply-To: david@angra.uac.pt To: questions@freeBSD.org Subject: fgets/fputs Date: Mon, 23 Apr 2001 17:08:29 +0000 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <0104231717100C.05409@david> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have a doubt on libc: Both fputs and fgets functions use a char* instead of char[255] fgets (char *s, int count, FILE *stream) fputs (const char *s, FILE *stream) but the program only works when I define char[255] instead of char* as I show in the source code below:...Why? int main() { char str[255]; int i; i=255; fgets (str, i, stdin) ; fputs (str,stdout) ; exit (1); } ------------------------------------------------------------ David Sousa Mendes LAMTec- Laboratório de Ambiente Marinho e Tecnologias Telefone : 96.4470312 Residência : R. da Graça, nº 90 9760 - Praia da Vitória Ilha Terceira To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message