🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #15834

Re: Como ha quedado lo de leer de stdin?

#15834
From: J.A. Gutierrez
Date: Fri, 02 Jun 2000 00:00
35 lines
1628 bytes
Carles Sadurn� Anguita <isard@localhost.localdomain> wrote:
: #include <stdio.h>
: #define MAXBUFF 1024

: main()
: {

: char *buff;

	deberia ser buff[MAXBUFF]

: while (1)
: {
: 	printf("Jarlll!, pierdes aceite?\n");
: 	fgets(buff, MAXBUFF, stdin);
: 	if (buff[0] == 'x')
: 		break;
: 	else
: 		printf("%s \n", buff);

	adefmas, fgets no se cepilla el \n de la cadena, asi que tu '\n' sobra

: }

: return 0;
: }

	aparte de eso, si, es correcto.


-- 
PGP and other useless info at      \                 Oh, show us the way
http://www.cps.unizar.es/~spd/      \             to the next whisky bar
finger://daphne.cps.unizar.es/spd    \                      Weill/Bretch
es doloroso ser sabio y descubrir la sopa de ajo                   (Pla)
Technical Details
Message-ID: <8h8dqn$r5m$2@news.unizar.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <slrn8jb068.21s.isard@localhost.localdomain> <1ebizqu.w6tte818zqxk4N%foviedoa@teleline.es> <slrn8jdv7k.da0.isard@localhost.localdomain>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,f3bc800a984cf1d6
X-Google-Attributes: gidf86c8,public
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Subject: Re: Como ha quedado lo de leer de stdin?
Date: 2000/06/02
Message-ID: <8h8dqn$r5m$2@news.unizar.es>
X-Deja-AN: 630218584
Content-Transfer-Encoding: 8bit
References: <slrn8jb068.21s.isard@localhost.localdomain> <1ebizqu.w6tte818zqxk4N%foviedoa@teleline.es> <slrn8jdv7k.da0.isard@localhost.localdomain>
Content-Type: text/plain; charset=ISO-8859-1
X-Complaints-To: usenet@news.unizar.es
X-Trace: news.unizar.es 959953559 27830 155.210.152.20 (2 Jun 2000 13:45:59 GMT)
Organization: Rank
Mime-Version: 1.0
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (IRIX/6.2 (IP22))
NNTP-Posting-Date: 2 Jun 2000 13:45:59 GMT
Newsgroups: es.comp.os.linux.programacion