no print function output do while

dark777 jeanzonta777 at yahoo.com.br
Thu Sep 28 19:18:08 UTC 2017


On Thursday, 28 September 2017 at 18:46:56 UTC, Ali Çehreli wrote:
> On 09/28/2017 08:13 AM, dark777 wrote:
>> no print function output do while
>> 
>> in my program after entering the data and select the function 
>> that will print on the screen the same is not printing ..
>> 
>> and if I choose 'q' or 'Q' does the program not close what is 
>> happening?
>> should not it work just like in C ++?
>> 
>> https://pastebin.com/iiMVPk4x
>
> You made a simple logic error. Change the following || to &&:
>
>     }while(choice != 'q' || choice != 'Q');
>
> Ali

I think it should not give this error

good but until now I do not understand why after I enter with 
data in the function add_human

the same is not printed when I choose the 'p' or 'P' option in 
the case

void print_list(Human[] human_list)
{
  foreach(human; human_list)
    {
     writefln("\nNome: %s",human.name);
     writefln("Peso: %0.2f",human.peso);
     writefln("Idade: %d\n",human.age);
    }
}


More information about the Digitalmars-d-learn mailing list