+ 14
Best alternative for scanf to avoid buffer overflow?? What's wrong with this.... How do I prompt user of inputted space or char
When I type invalid input... It displays enter a valid input... But doesn't take the input... Why is so can someone help..? https://code.sololearn.com/c28bJ5t1fW0K/?ref=app
28 odpowiedzi
+ 6
Ohk I will try it tnx
+ 6
Tnx Aman but still I have to fix some issues such as inputting space then user should be promoted etc
+ 5
What if I want to enter wrong input twice it as many times then it is not working just input and see
10 9 6
+ 5
Also spaces aren't counted at all ..
+ 5
ChaoticDawg do u mean a do while loop ...
But I tried it and it gives
Enter a valid input and doesn't print the pattern
+ 5
Tnx man u helped me
+ 5
Tnx everyone 👍
+ 5
Jude img src tag
+ 5
Tnx
+ 4
Enter both at the same time when the playground asks for your input like:
10
6
+ 4
Made a few slight modifications to your code so it will loop until valid entry etc.
https://code.sololearn.com/cQDlwTa1KQ1S/?ref=app
+ 4
So Stephen what should I use instead of scanf
+ 4
To take input??
+ 4
Also u have to specify it's width and height so to avoid problems
+ 4
Ok tnx
+ 4
Tnx
+ 3
You are having input problems
You have to give all your inputs at once like :
9
6 and enter
Sololearn playground works like this only :)
+ 3
Yup the solution to the problem by Daljeet Singh and
ChaoticDawg is right.
You just need to enter both the values at the same time either with a space or an enter. Then you can press submit to get the correct output.
+ 3
Prathik Shetty you aren't looping over that part of your code. If that's what you want to do then you'd need to wrap your code in a loop that exits the loop when a valid entry is made.
+ 2
Nice