This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I was trying to make above code in C. And what i found boolean is not defined in C,sorry i was like What.
Ok fine let us C, i will use true and false as the string for testing.
Then i use keyword "string" as habitual of java,now string is also not there, undefined keyword.
You have to use to char ,now am pissed.
Finally i made it somehow.It's very difficult for me to learn C again after Java.
fred rosenberger wrote:most variables in C can be uses as booleans. 0 is considered false, and 'not zero' is considered true.
Hi really thanks for the reply,
I have tried what you have advised,it works.
zero and non zero can be used inplace of boolean value.
C is still language of last decade for me, mixing Java and C, a tough job.
Actually, C99 and later define a type "_Bool"; the header "stdbool.h" defines macros "bool", "true" and "false", which evaluate to "_Bool", "1", and "0", respectively. The more recent C++ standard includes an actual type "bool" and actual type literals.