Thread: integer constant is too large for 'long' type

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    13

    integer constant is too large for 'long' type

    I want to assign 0x0000041727101980 to int64_t, but the above warning is coming i.e. integer constant is too large for 'long' type.

    how can I overcome it using the type int64_t

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    I think integer constants are assumed to be a long, unless you specify otherwise. try adding "LL" to the end of your constant, like so:
    Code:
    0x0000041727101980LL

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    13
    Hey, thanks a lot, problem is solved with LL ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 03-04-2012, 12:56 AM
  2. on 16-bit system long will guarantee 4-bit integer type?
    By jackson6612 in forum C++ Programming
    Replies: 1
    Last Post: 04-05-2011, 10:45 AM
  3. Replies: 7
    Last Post: 06-01-2008, 07:47 AM
  4. integer constant is too large for type
    By Abda92 in forum C++ Programming
    Replies: 8
    Last Post: 02-09-2008, 11:47 AM
  5. is there an infinitely large integer type?
    By MKashlev in forum C++ Programming
    Replies: 7
    Last Post: 08-10-2002, 02:31 PM