Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. a very looooong integer

a very looooong integer

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    knapak
    wrote on last edited by
    #1

    Hi geeks... I mean guys guys...:laugh: I need to use a very large integer that does not fit in a long. So I attempted using _int64 and the values are at least stored in the declared variable. However if I try to send it to the screen, it gives me this compiler error... error C2593: 'operator <<' is ambiguous Can anyone give me a simple explanation and solution? Is there any other place I need to be aware of where I'll run into trouble if using this data type? Thanks a bunch!!!

    C B 2 Replies Last reply
    0
    • K knapak

      Hi geeks... I mean guys guys...:laugh: I need to use a very large integer that does not fit in a long. So I attempted using _int64 and the values are at least stored in the declared variable. However if I try to send it to the screen, it gives me this compiler error... error C2593: 'operator <<' is ambiguous Can anyone give me a simple explanation and solution? Is there any other place I need to be aware of where I'll run into trouble if using this data type? Thanks a bunch!!!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      knapak wrote: error C2593: 'operator <<' is ambiguous operator << is not defined for __int64. Therefore it has to try and cast it to something else ( which is plainly not going to work BTW ), and it can't decide what it should cast it to, hence the operator is ambiguous. You probably have to define your own operator <<, and I guess then any other STL operation you try to do, that is type specific. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • K knapak

        Hi geeks... I mean guys guys...:laugh: I need to use a very large integer that does not fit in a long. So I attempted using _int64 and the values are at least stored in the declared variable. However if I try to send it to the screen, it gives me this compiler error... error C2593: 'operator <<' is ambiguous Can anyone give me a simple explanation and solution? Is there any other place I need to be aware of where I'll run into trouble if using this data type? Thanks a bunch!!!

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #3

        Hello, The __int64 is not supported by the standard, but it is rather compiler specific. The C standard has support for a 64 bit integer: long long. See here[^] for more information. You always can write the number in hexadecimal in two steps: first write the upper 32 bits and then the lower 32 bits. :) Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups