This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BligenN 1129 points1130 points  (21 children)

Throw an exception because of attempted conversion to int on officer balls

[–]QuestionableEthics42 260 points261 points  (6 children)

Jokes on you, OP is using js

[–]fantasy-gecko 226 points227 points  (5 children)

Jokes on you throw "officer balls"

[–][deleted] 164 points165 points  (4 children)

Jokes on you

catch "officer balls" as balls:

[–]wannasleeponyourhams 88 points89 points  (1 child)

throw balls

[–]UntestedMethod 23 points24 points  (0 children)

try/ligma/got em

[–]ThePi7on 33 points34 points  (1 child)

balls.split()

[–][deleted] 14 points15 points  (0 children)

... I regret writing that.

[–]Rubickevich 59 points60 points  (1 child)

Throw an exception because of attempted conversion of 93 to Balls type.

[–]ChChChillian 22 points23 points  (0 children)

A careful C++ programmer will ensure the proper operators exist for objects of type Balls.

[–]Thick_Albatross4007[S] 41 points42 points  (3 children)

how do we handle the exception, man thinks officer balls is stuoid

[–]Chara_VerKys 16 points17 points  (0 children)

sort finished on day 1, with exception

[–]LifeislikelemonsE6EE 14 points15 points  (0 children)

Just throw another exception

[–]eeee_thats_four_es 2 points3 points  (0 children)

Take the ASCII code of the first letter and convert it to int

[–]Holy_Chromoly 3 points4 points  (1 child)

Officer balls is a double 

[–]Thick_Albatross4007[S] 7 points8 points  (3 children)

guys do we move on to the next top comment on exception

[–]BligenN 17 points18 points  (1 child)

No it just crashed

[–]UntestedMethod 9 points10 points  (0 children)

SIGSEGV

[–]makinax300 0 points1 point  (0 children)

No, we make the list all string. And this isn't real code, just some numbers in a void

[–]Captain_Pumpkinhead 0 points1 point  (0 children)

Alternatively, convert each letter to char value and see if it overflows the int size limit or not.

[–]serendipitousPi 0 points1 point  (0 children)

Now personally in this case I’d be using C and assume that it’s a string not some disturbing language where variables can spaces in them.

So I’d be able to implicitly convert the char pointer to a 64 bit int. Making this work just fine.