Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Quint64 initialisation without Q_UINT64_C
Forum Updated to NodeBB v4.3 + New Features

Quint64 initialisation without Q_UINT64_C

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.6k 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.
  • M Offline
    M Offline
    marcus.fr
    wrote on last edited by
    #1

    Hi

    I have a 64 bit integer initialized like this:
    @quint64 myInt = 18446744073709550616;@

    I get no compiler error (MSVC2010-32bit). However the documentation on this says:

    --
    typedef quint64
    Literals of this type can be created using the Q_UINT64_C() macro:
    quint64 value = Q_UINT64_C(932838457459459);

    Even though I have no compiler error with regular initialization, I wonder if I should use Q_UINT64_C to make the code cross-platform safe? Ex:
    @quint64 value = Q_UINT64_C(18446744073709550616);
    quint64 value = Q_UINT64_C(0);@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved