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="Ben Bacarisse, post: 3936193"] There is something suspicious about these escape characters being in the output of ls but I can't put my finger on what. I don't get them in my ls output for example. It may just be a remnant from ls's colouring, but it may be more significant. How odd. In the curious world of language standards the output is perfectly acceptable, despite being the most surprising thing at first glance. Since the program violates a language constraint, any output all is possible, so this seemingly surprising result is perfectly legal. The only error is that the compiler must issue a diagnostic and it appears not to. On a practical note, I'd suggest that gcc has been turned into a script that silently refuses to generate code for erroneous programs and you are running the result of compiling another source with the same name which has since been deleted. Since it will be for the same exercise, it generates the correct output interaction. At least that is the least contrived explanation I can come up with. Check the dates and times on the files and/or delete the executable before compiling. I think you would be justified in deducting marks for not using printf correctly but if the students also fail to see the required diagnostics I'd be inclined to be lenient. If they really are using a weird system that gives the output you show (i.e. my guess above is wrong) then you need to be more lenient still, but no reading of any reasonable C text (or presumably your notes) could lead the student to write what they did. On a side issue, no rubric should permit full marks for a program that fails to check that the input was successful. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Weird usage of printf/scanf? Why do they work?
Top