Solved

show an integer in a messagebox

Posted on 2001-08-24
4
912 Views
Last Modified: 2008-01-09
I want to know how to turn an integer into character to display from a message box:

NewFile.nPolys is the integer (part of a structure) that i want to insert at the end of the string "The number of polys is ".

MessageBox(NULL, <this is the function i want to use>, "whassup", NULL);

thanks
0
Comment
Question by:MitchBroadhead
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
MDarling earned 50 total points
ID: 6421513
char s[1000];

wsprintf(s,"The number of polys is %d",NewFile.nPolys);
MessageBox(NULL,s,"Whassup",NULL);

Regards,
Mike.
0
 
LVL 3

Expert Comment

by:MDarling
ID: 6421515
1000 chars is a bit overkill though :)

40 should do fine.

Regards,
Mike.
0
 
LVL 2

Expert Comment

by:bkdc
ID: 6421564
....
 int q=1002;
 char buff[50];
 _itoa(q,buff,10);  //_itoa(int no,char &,int radix);
 MessageBox(NULL, buff, "whassup", NULL);
....


0
 
LVL 1

Author Comment

by:MitchBroadhead
ID: 6421585
thanks darling.
worked a treat.  
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

815 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

13 Experts available now in Live!

Get 1:1 Help Now