Results 1 to 3 of 3

Thread: Working with long long in C

  1. #1

    Working with long long in C

    Hello again. If you've read the programming challenge thread, you'll know I made a factoring program that I'm trying to convert to 64-bit. I have two problems. The first is getting a 64-bit value from the prompt. Here is the line from my source code that should do it. "number" is an unsigned long long by the way.

    Code:
    number=strtoull(argv[1],0,10);
    The second passed value is 0 because I want it to discard errors the user types. I'm not putting in error protection right now. So this works for numbers below 2 ^ 32, but after that it returns false numbers. I can't see what the failure is.

    Also, is there a way to print long long integers with printf or a similar function? I'd even settle for a function that converts it to a string, but it would be very hard to make my own. Any ideas? Thanks.

  2. #2

    Re: Working with long long in C

    Nevermind. I have no idea how but I got it to work.

  3. #3
    Guest

    Re: Working with long long in C


    Nevermind. I have no idea how but I got it to work.
    i think that phrase has been said countless times over at Microsoft

Similar Threads

  1. Been too long
    By mcdougrs in forum General Chat
    Replies: 5
    Last Post: 09-19-2005, 05:12 PM
  2. The long arm of the law
    By Fatal Error in forum General Chat
    Replies: 1
    Last Post: 08-03-2005, 04:41 PM
  3. So Long ATA
    By BurntAsh in forum General Chat
    Replies: 7
    Last Post: 10-27-2004, 10:47 PM
  4. Gone for so long
    By Asbenson in forum General Chat
    Replies: 4
    Last Post: 07-30-2004, 06:04 PM
  5. ... of Gods, LFS, and men. (long)
    By Feztaa in forum Linux - General Topics
    Replies: 24
    Last Post: 01-27-2002, 08:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •