[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Convert integer to string for display in a label

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!!!

1 Solution
Jaime OlivaresCommented:
Try with:

strTotal = Convert::ToString(intLines);
DozaAuthor Commented:
Perfect.  I knew it wasn't as hard as some of the solutions I found on Google.  Thanks!!!!

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now