News for hackers. Stuff that matters.
Re:One Response to Rejection by kirubakaran on Friday April 11, 2008 @07:35PM (#161489)
YC != 42?
Re:One Response to Rejection by bsaunder on Friday April 11, 2008 @10:39PM (#161589)
Obviously, YC == 5943
Re:One Response to Rejection by icky on Friday April 11, 2008 @11:35PM (#161618)
If you want an upvote, you'll have to show your work... ;)
Re:One Response to Rejection by bsaunder on Saturday April 12, 2008 @12:11AM (#161632)
man ascii ;)
Re:One Response to Rejection by icky on Saturday April 12, 2008 @12:24AM (#161641)
Still haven't shown your work... did you remember to assign the numerical values of the string "YC" to the integer variable YC?

And did you remember to test against 0x5943, rather than 5943?

And did you take Endianness into account? ;-)

Re:One Response to Rejection by bsaunder on Saturday April 12, 2008 @01:33AM (#161686)
I guess I could do all that (truth be told, my C's a bit rusty for a prompt answer).

How 'bout:

  $echo -n "YC" > foo
  $hd foo
  00000000  59 43                                             |YC|
  00000002
Yeah, I know, perhaps 4359 might be better.

(UPDATE: fixed code spacing)

Re:One Response to Rejection by icky on Saturday April 12, 2008 @02:28AM (#161712)
:-D
Re:One Response to Rejection by tlrobinson on Sunday April 13, 2008 @02:26AM (#162263)

    printf("%hx", *(unsigned short *)"YC");
...works on big endian machines. this works everywhere:

    printf("%hx", htons(*(unsigned short *)"YC"));