[C con Clase] donde esta el error?
Joe Tend
neojtr en hotmail.com
Jue Oct 22 17:28:25 CEST 2009
//ni idea de donde pueda estar el error aca...
a=fopen("participantes.txt","r");
while (!feof(a))
{
fread = (&gana,sizeof(gana),1,a);
cont++; //ACA CUENTO LA CANTIDAD DE GENTE PARA HACER LA RIFA
}
if(cont!=0)
{
ganador = rand()%(cont-1); //ACA SE REALIZA LA RIFA
rewind(a); //REBOBINO EL ARCHIVO PARA VOLVER A LEER DESDE EL PRINCIPIO
for(int i=0;i<=ganador;i++) //BUSCO AL GANADOR
{
fread=(&gana,sizeof(gana),1,a);
}
cout<< " el ganador es: " <<gana.nombre << " " << gana.cedula; //Y LO MUESTRO...
system("pause>null");
break;
}
else
{
cout << "\nNo hubieron participantes";
break;
}
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.conclase.net/pipermail/cconclase_listas.conclase.net/attachments/20091022/2bb7e105/attachment.html>
Más información sobre la lista de distribución Cconclase