At Saturday 10/18/2008 00:03, you wrote: >HelloWorld never! > >Hello OR World, but never both at the same time!
Well, yes, you CAN print both Hello and World. See the response by Jaspreet Singh. >If "condition" yields a ZERO OR ITS EQUIVALENT, then you may say >it's NOT fulfilled. > >If "condition" yields ANYTHING ELSE THAN ZERO OR ITS EQUIVALENT, >then you may say it's TOTALLY fulfilled. > >char s[6]="Jugal"; // The null character is at the end, s[6] > >if (s[6]) This SHOULD be s[5]. s[6] is out of bounds. >cout << "ANYTHING ELSE THAN ZERO"; >else >cout << "ZERO"; // Prints ZERO > >if (*(s+6)) This SHOULD be *(s+5). *(s+6) is out of bounds. >cout << "ANYTHING ELSE THAN ZERO"; >else >cout << "ZERO"; // Prints ZERO > >if (-1.23456) >cout << "ANYTHING ELSE THAN ZERO"; // Prints ANYTHING ELSE THAN ZERO >else >cout << "ZERO"; > >Best, > >Geraldo ~Rick
