Convert integer to string for display in a label

Posted on 2005-04-28
Last Modified: 2010-04-24
I'm trying to teach myself Visual C++ and I cannot seem to figure out how to do this (simple) task.  I am trying to read a file and update a label on my form to show how many lines have been read.  What I cannot seem to get is how to convert the counter into a string so that I can use it as the Text for the label.

bascially, i have:

int intLines;
String * strTotal;

<...code to read the file and update the counter...>

strTotal=toString(intLines);  //obviously this doesn't work


If the answer requires any other includes, can you please specify those too?

Thanks for any help!!!

Question by:Doza
    LVL 55

    Accepted Solution

    Try with:

    strTotal = Convert::ToString(intLines);

    Author Comment

    Perfect.  I knew it wasn't as hard as some of the solutions I found on Google.  Thanks!!!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now