?

Log in

No account? Create an account

Previous Entry | Next Entry

11111 + 1 = 100000

Yay! I am now sizeof(unsigned long int).

Oh wait, times 8. Crap... I have totally forgetten how to code. (Apparently, memory leaks in your brain can cause memory leaks in your integer arrays.)

Comments

( 9 comments — Leave a comment )
agentsteel53
Nov. 19th, 2008 03:31 pm (UTC)
on what system are ints 8 bits and long ints 16? I remember sizeof(char) == 8, sizeof(int) == 16, and sizeof(long) == 32 on the intel 8088 and up.
spoonless
Nov. 19th, 2008 09:06 pm (UTC)
Right, sizeof(long) is 32 in bits... which is why I wrote that originally. Then I remembered that sizeof returns the size in *bytes*, so it actually evaluates to the number "4".
agentsteel53
Nov. 19th, 2008 09:22 pm (UTC)
oh my, glad we're not writing the next web browser. we'd be buffer-overrun in ten seconds.
agentsteel53
Nov. 19th, 2008 09:24 pm (UTC)
and I had misinterpreted the "times eight". I quickly multiplied 100000 by 8, getting 1,00000000 - i.e. an overrun if ints are 8 bits, and thus you needing a long int to represent your age.

note to self: never do work when first waking up... already knew this one! and, also, apparently, never read livejournal posts from my more technically oriented friends!
saffroncisco
Nov. 19th, 2008 05:11 pm (UTC)
Yay!
May it be a joyous day and a beautiful year. :)
spoonless
Nov. 19th, 2008 09:05 pm (UTC)
Re: Yay!
Nice icon! Apropos :)
eric_schulman
Nov. 27th, 2008 01:45 am (UTC)
Re: Yay!
Four years until the next perfect square and five until the next prime. :)
sapience
Nov. 19th, 2008 08:10 pm (UTC)
Many happy returns of the day!
kaolinfire
Nov. 20th, 2008 11:24 pm (UTC)
happy belated :)
( 9 comments — Leave a comment )

Profile

blueshirt
spoonless
domino plural

Latest Month

May 2017
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28293031   

Tags

Powered by LiveJournal.com
Designed by Lizzy Enger