Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

ANSI C Puzzle

Name: PR 2012-11-14 18:28

Name: Anonymous 2012-11-14 18:31

Do your own homework mate.

Name: Anonymous 2012-11-14 18:57

Checking to see if an unsigned integer is less than a negative integer? Nothing could go wrong!

Name: Anonymous 2012-11-14 19:00

#include <limits.h>

#define SPECIAL_INDEX USHRT_MAX

Right in the aner!

Name: Anonymous 2012-11-14 19:08

Lambda Arthur Anerlus

#define SPECIAL_INDEX (~(unsigned short) 0)

Name: Anonymous 2012-11-15 0:59

>>3
THAT WAS UNEDEFINED QUALITY!

Name: Anonymous 2012-11-15 1:28

>>6
It's actually defined.

Name: PR 2012-11-15 7:24

>>2
Actually I invented it
>>3
Yea, got troubles to find some UAC shit that behaves differently on 32 bit and 16 bit architectures..

Name: Anonymous 2012-11-15 7:26

Here's a puzzle for you: Why would anyone use undefined shit?

Name: PR 2012-11-15 7:32

>>9
It is defined in UAC in ANSI C.
And the story is just to make it more interesting. But you're right, nobody will use it.

Name: Anonymous 2012-11-15 9:03

I think it is because of widening of the short during the comparison. I think this is because negative integers are bigger in length , so the unsigned short is converted to whatever length the signed int is instead of what you expected to happen.

Name: Anonymous 2012-11-15 12:44

>>11
pls respond

Name: Anonymous 2012-11-15 13:35

>>12                                            `
>my lel face when
>2012
>NOT using void.h
>srsly
>guise
>no.png

Name: Anonymous 2012-11-15 13:45

>>13
/backplate kebags/

Don't change these.
Name: Email:
Entire Thread Thread List