🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Ayuda novato.

#10095
From: Jesús Carrete Montaña
Date: Sun, 24 Mar 2002 11:32
47 lines
2753 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Javier" == Javier Beltr�n S�nchez <quantium@lycos.es> writes:

    Javier> Buenas.  Tengo una peque�a duda con ficheros en C,
    Javier> imaginemos que dentro de un programa pongo un bucle para
    Javier> que se repitan "x" veces la palabra "hola", y que cuando
    Javier> se terminen de repetir las "x" veces, el programa pregunte
    Javier> si se quieren guardar los resultados.  � alguien me podria
    Javier> ayudar ?  Muchas gracias y un saludo.

        No te entiendo muy bien. A ver, supongamos que la primera
parte es algo as�:

for(i=0;i<10;i++)printf("Hola\n");

        Pero ahora, �qu� resultados quieres guardar? �El de repetir 10
veces la palabra "Hola"? Me imagino que no, as� que intenta
especificar un poco m�s. De todos modos, suponiendo que tengas una
funci�n guarda_resultados(), lo de preguntar al usuario ser�a algo
como esto, por ejemplo:

char character;
printf("�Quiere guardar los resultados?\n");
while(1){
        character=tolower(getchar());
        if(character=='s'){
                guarda_resultados();
                break;
        }else if(character=='n')
                break;
        else
                printf("\nPor favor, conteste s o n.");
}

Un saludo.
- -- 
I am Bill Gates of Borg. Windows is futile. You will be restarted.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 <http://mailcrypt.sourceforge.net/>

iD8DBQE8nbkpfUtQQKOnZ1IRAmAMAJ44hsD0vCg82i10gdTLiWx13i2OJwCg4ZY0
k8JprfjcIG+CV0BI3Ixwqcw=
=56Bi
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <873cyq42wu.fsf@meltdown.ion>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213-98-107-123.uc.nombres.ttd.ES!not-for-mail
References: <ab4993a4.0203231224.6f730adc@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,365f9375de182bd1
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-03-24 04:05:38 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213-98-107-123.uc.nombres.ttd.ES!not-for-mail
From: kuantiko@escomposlinux.org (Jesús Carrete
  Montaña)
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Ayuda novato.
Date: 24 Mar 2002 12:32:17 +0100
Organization: ecolnet
Lines: 47
Sender: kuantiko@meltdown.ion
Message-ID: <873cyq42wu.fsf@meltdown.ion>
References: <ab4993a4.0203231224.6f730adc@posting.google.com>
NNTP-Posting-Host: 213-98-107-123.uc.nombres.ttd.es (213.98.107.123)
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1016971505 22957394 213.98.107.123 (16 [64988])
X-Orig-Path: antonio.escomposlinux.org!relativistic.homeip.net!nobody
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7