Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Weird usage of printf/scanf? Why do they work?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nick Keighley, post: 3936403"] that shouldn't compile on any reasonable system (assuming a prototype in scope). The first argument of printf() is wrong. this is permitted to compile the extra arguments are just ignored. as others ahve pointed out there is something very odd with your version of gcc. But ignoring that, ths printf(0 statement is plain constraint violation and hence should generate a diagnostic (error or warning). Check the standard or any good textbook. this makes sense well it isn't a compile-time constant, but I'd say that hardly mattered as it's the worng type... as it is supposed to there you are mark both of them as wrong. One isn't correct C and the other doesn't work. do so you don't program from examples you program from a specification or standard. no-one puts embedded LISP in their C programs or expects quotes fome Shakespere (now there's challange to clc!) to execute. They're wrong as well. The number of things that are wrong is unboundedly large. You can't expect examples of all of them. I'm *very* dubious of that. Your tests aren't good enough. Run it on another computer. Write a decent test harness. The scanf() *can't work* [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Weird usage of printf/scanf? Why do they work?
Top