Hello :-)

I have build a task of Linked List but for some reason , after i break the Input sequence by entering the same INT value twice in a row , the menu appears twice . howcome?

Thank , Code Attached .

Yotam

because the keyboard buffer still contains the <Enter> key -- you need to flush that out. One way is like below, which will remove up to 3 keys.

char inbuf[4];
  menu();
  fgets(inbuf,sizeof(inbuf),stdin);
  //scanf("%c",&choise);
  choise = inbuf[0];
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.