First of all, hello everyone.
I'm pretty much a virgin, here and in programming.
So the problem is:
when I'm trying to terminate the loop by answering "S" or "s" it doesn't terminate. It just goes on and on, no matter what I input to $o. Can anyone explain me why it doesn't break the loop?Code:do { printf("Introduza o nome do contacto(max. 32 caracteres):\n"); getchar(); gets(contacto1.nome); printf("Introduza o número de telefone:\n"); scanf("%d", &contacto1.num); printf("Introduza a Data de Aniversário(dd/mm/aaaa):\n"); //É preciso implementar verificação de data correcta for(i=0;i<12;i++) { scanf("%c", &contacto1.bday[i]); } printf("Os dados são:\nNome: %s\nNúmero: %d\nData de Nascimento: ", contacto1.nome, contacto1.num); for(i=0;i<12;i++) { printf("%c", contacto1.bday[i]); } printf("\nPretende guardar este contacto?(S\\N)\n"); scanf("%c", &o); }while(o!='S' || o!='s');
Thank you and sorry for my english. I'm portuguese as you can see by the piece of code in there.