convert uint32_t to int

Posted on 2009-02-13
Last Modified: 2012-06-21
how can I do this?
Question by:kuntilanak
    LVL 86

    Accepted Solution

    By casting - you can either use a C-style cast like

    uint32_t u =42;
    int i = (int) u;

    or a C++-style cast

    uint32_t u =42;
    int i = static_cast<int>(u);
    LVL 86

    Expert Comment


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    This video teaches viewers about errors in exception handling.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now