Like Tree1Likes
  • 1 Post By Elkvis

integer constant is too large for 'long' type

This is a discussion on integer constant is too large for 'long' type within the C++ Programming forums, part of the General Programming Boards category; I want to assign 0x0000041727101980 to int64_t, but the above warning is coming i.e. integer constant is too large for ...

  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
    2,149
    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
    rehman12390 likes this.

  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-03-2012, 11:56 PM
  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, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21