it just skips over this
instead of letting me input a char in varCode:scanf("%c",&var);
??
This is a discussion on why the compiler skips this line.. within the C Programming forums, part of the General Programming Boards category; it just skips over this Code: scanf("%c",&var); instead of letting me input a char in 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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
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
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
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();
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
> 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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.