g++ cast uint32_t to long unsigned int?

John (Eljay) Love-Jensen eljay@adobe.com
Wed Apr 28 13:58:00 GMT 2010


Hi lee,

>    Can this be done!

Yes.

int main()
{
  typedef unsigned int uint32_t; // may vary by platform
  uint32_t u32 = 7;
  unsigned long int uli = static_cast<unsigned long int>(u32);
}

--Eljay



More information about the Gcc-help mailing list