So fflush(stdin) is undefined?
Because my c programming book uses it as a way to clear the input buffer. (The book: Sams Teach Yourself C in 21 Days, 4th edition.)
So fflush(stdin) is undefined?
Because my c programming book uses it as a way to clear the input buffer. (The book: Sams Teach Yourself C in 21 Days, 4th edition.)
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Your book is wrong. FAQ > Explanations of... > Why fflush(stdin) is wrong
Sams Teach Yourself C in 21 Days - Review
And that's the 5th edition!In fact, it seems to be the worst book on C I have ever seen.
Got any tables with a short leg?
gg
MSDN fflush I thought it worth noting that while fflush(stdin) in not standard, it's not 'always' wrong.
Regards,
Brian
Sure, while we're at it, you use void main in Java. However, that wasn't the question. The question was is it standard. The answer is: no. End of discussion.
Quzah.
Hope is the first step on the road to disappointment.
4th, actually. You misread my post. But I agree with you.And that's the 5th edition!
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
The review was of the 5th edition.
>> And that's the 5th edition!
My comment was based on the assumption that edition N+1 is typically better than edition N.
But in this case, I can see how the 5th edition may actually be worse than the 4th.
gg
Somehow I don't see anything about 'standard' in the OPOriginally Posted by quzah
Well you're just an idiot then. The term "defined" in reference to programming, specifically the C language, is "as defined by the standard". Therefore, the term "undefined" means "not defined by the standard". So perhaps you're not an idiot, just ignorant. Now, unless you really are an idiot, you have no excuse. If you are an idiot, you're at least an informed one now.
Quzah.
Hope is the first step on the road to disappointment.
Does the name calling make you feel bigger and better? I'm sure you'd like me to get all upset and come unglued on the forum. I don't accept your definition of "defined". Better go work on your coding and interpersonal skills instead of your post count flames. BKOriginally Posted by quzah
I'd say quzah's correct. Trying to define "defined" any other way makes it completely useless. A compiler could be written that gives defined behavior to negative array subscripts, but that in no way makes negative array subscripting a defined operation in general. Whether or not you accept this is a personal issue.Originally Posted by Br5an
If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein
Sure, if you don't care about writing portable code, and always plan on using the same compiler.Originally Posted by Br5an
I'm supposed to care what you think why again? Also, I've yet to see anything wrong with my coding. When someone noteworthy points it out, I'll pay attention. Until then, sod off, as they say.Originally Posted by Br5an
Quzah.
Hope is the first step on the road to disappointment.
Yeah, and I'm going to stop writting WinAPI because it's not 'defined' by ANSI / ISO. BK
That is completely different. It is an API not a 'standard library'.Originally Posted by Br5an