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="Mug, post: 3936160"] hi i test the program on my PC,i picked the last one, sine all those 3 have the similar problem here is the result: zsh/2 4641 % gcc -ansi -pedantic -Wall wierd_questions.c wierd_questions.c: In function ‘main’: wierd_questions.c:21: warning: too many arguments for format wierd_questions.c:23: warning: too many arguments for format wierd_questions.c:24: warning: too many arguments for format wierd_questions.c:26: warning: too many arguments for format wierd_questions.c:31: warning: too many arguments for format wierd_questions.c:34: warning: too many arguments for format wierd_questions.c:37: warning: too many arguments for format wierd_questions.c:42: warning: too many arguments for format wierd_questions.c:45: warning: too many arguments for format wierd_questions.c:48: warning: too many arguments for format so the warnings are from scanf <mug@arch:/media/data/progC> zsh/2 4642 % ./a.out Input three different integers: 1 2 3 Sum is Average is Product is Smallest is Largest is % in execution, we see that the all the elements after Sum is are ignored, which is the normal behavious of printf in conclusion, you must use the MAC, it always have some strange behavious,i've once worked with a friend on a C project and damn she had a mac, there were some strange behavious(like if she don't initilize a int, the compilateur will initilize it to zero automatiquely etc) on her code, they works correctly on her machine but not on linux nor on windows,and i suppose ur student must use windows or mac too. i think that problably is the problem. best regard [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Weird usage of printf/scanf? Why do they work?
Top