HI,
Plz let me know, why this program behave so.
Rgds,
madhu
HI,
Plz let me know, why this program behave so.
Rgds,
madhu
It behaves like it does because its doing what you told it to do.
What exactly is it supposed to do?
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Hi,
Yes i know.
But i would like to know the reason for that.
how it is being interpreted.
If you know plz post the answer
Regards,
madhu
Heh, let's give the newbies an ioccc entry and see what they make of it.
If your teacher gave you this, they're an idiot.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
The hardest part of it is to understand that
i[p] and p[i] are the same (p is a pointer, i is an integer).
And a string literal is a pointer, so
i["bla"]
means the same as
"bla"[i]
or
const char *p = "bla";
p[i]
so it takes the ith character (0-based).
But I fully agree with Salem.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Even worse is the fact that the output is implimentation dependent, and that the putchar line invokes undefined behaviour!
I'm glad I didn't learn C from someone who hands out such code.
Ian Woods
> and that the putchar line invokes undefined behaviour!
LOL, so that's why it only works for me first thing in the morning.
> putchar ( ++c=='Z' ? c = c/ 9:33^b&1);
After 9:33 am, it all goes weird on me
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.