Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 1
    You might want to review the code you posted. It seems that there has been some issue with the copy-n-paste Commented Jun 24, 2013 at 20:42
  • 1
    If you're compiling a 64-bit program from that code, it should be able to happily allocate the 4GB of memory required to hold a billion integers. Commented Jun 24, 2013 at 20:47
  • 1
    @TaylorBrandstetter: Of course, if you typed if (!p) that would not be an issue at all and it would be readable (without resorting to Yoda programming) Commented Jun 24, 2013 at 20:49
  • 3
    @Taylor It's considered good practice by many who don't turn up their compiler's warning settings high enough to put .... There, FTFY :) Commented Jun 24, 2013 at 20:49
  • 1
    @MattPellegrini, are you sure your number doesn't have an additional zero? Is it really 1bln what you enter and not something even bigger? Commented Jun 24, 2013 at 20:51