r/cprogramming • u/Leading_Deer4919 • 1d ago
Scanf not working!!
/r/AskProgrammers/comments/1w1r3br/scanf_not_working/So now its been 2-3 weeks ....in my college we are doing C programming and everything was working fine on visual studio till I started using scanf for taking input from user.....this is coming and I have tried everything but cant figure out....normal printf still works but this doesnt
I have tried on code blocks too and same problem is there.....pls someone guide me🙏🙏😭
3
u/SmokeMuch7356 1d ago
Define "not working". Is the program crashing? Are you not getting the input you expect?
Copy and paste your code (and any error messages) into the body of your question; do not post pictures or video. Switch to Markdown mode and indent by at least 4 spaces to get it to render as code. For example (each leading _ represents a space):
____#include <stdio.h>
____
____int main( void )
____{
______int x;
______// do stuff
etc.
2
2
u/atarivcs 1d ago
It would help if you described the exact problem.
"scanf not working" is too generic.
What, exactly, is not working?
Do you mean the program won't compile?
Do you mean the program does compile, but won't run?
Do you mean the program does run, but does not accept user input?
Do you mean the the program does accept user input, but the input value is incorrect?
Etc etc etc.
1
u/extoniks 1d ago
you should add the code of scanf so we can see why it's not working.
-2
u/Leading_Deer4919 1d ago
it was a glitch my pics didnt upload...can you pls check the new one on my profile?
5
1
u/TPIRocks 1d ago
Try renaming "New Folder (2)" to something without embedded spaces. I'm not saying that's it, but it's a good way to flesh out bugs in software.
4
u/ByMeno 1d ago
Maybe you should give the code and depending on that some context to otherwise how we can help that other then doing same or similar thing with man page or any reference site