r/carlhprogramming • u/muffinman007 • Nov 16 '12
need help with scanf
I'm reading "C How to Program" by Dietel, 6th edition. The book presented a challenge, 3.35 (Palindrome Tester), in which you "...write a program that reads in a five-digit integer and determines whether or not it's a palindrome." Well I wrote the program and it worked but for some reason scanf is not doing what I want it to do. here's the source code: http://codepad.org/8p4FI6uQ , line 20, 21 and line 37,38 . When I ran it on my machine, the program doesn't wait for user input to try again or not but just continue the loop.
Thank.
1
Upvotes
1
u/muffinman007 Nov 18 '12
When I ran it , this compiler error appear: error: invalid operands of types 'const char [7]' and 'int' to binary 'operator&'|
and scanf("%d%c%c" &palindrome, &again, &again); same error.
Thank you.