it just skips over this
instead of letting me input a char in varCode:scanf("%c",&var);
??
it just skips over this
instead of letting me input a char in varCode:scanf("%c",&var);
??
Look in some of the half-dozen other of your threads which deal specifically with scanf issues.
And no, it's YOUR code which is the issue, not your compiler.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
there is no mistake
if it was written in a wrong way
the program wouldnt have ran from the beggining
why its skipping this line
??
You code can be wrong without causing a compile error.Originally Posted by transgalactic2
Because you wrote the code such that the flow of control skips that statement with the given input to your program, or maybe the flow of control does not skip that statement, but you have deceived yourself into believing that it does.Originally Posted by transgalactic2
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
so the scanf is correct?
Maybe. Without knowing the problem, the context and what exactly is var, concluding the correctness (or lack thereof) of that call of scanf is foolish.Originally Posted by transgalactic2
For example, is this correct?
Code:foo();
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
maybe its skipping because of the \0 in the buffer
Okay, enough of games. Post the smallest and simplest compilable program that demonstrates the problem.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
> there is no mistake
ROFLMAO - so says you with 1500 posts and no idea STILL how to use scanf properly.
Originally posted by brewbuck
Sit back and break out the marsh mallows.
You continue to use broken ideas, then post 1-liners with NO context, then complain that it doesn't work, and then complain at people trying to help you (futile: adj - helping transgalactic2)
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.