| | |
Displaying values of an array
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2006
Posts: 13
Reputation:
Solved Threads: 0
Hi, lets say I have an array of numbers
then I want to display a certain array element.
the value inside it,that is.
in pseudo code that would be..
int array[5][5];
for(x=0;x<6;x++)
{
if x= array[0][1];
}
;
;
;
message output " the value is array[0][1]"
I want to implement this in Visual C++.
using MessageBox command wont work unless i enclosed them in "" "" but that would not output the element in the array...Pls help.
Thanks
then I want to display a certain array element.
the value inside it,that is.
in pseudo code that would be..
int array[5][5];
for(x=0;x<6;x++)
{
if x= array[0][1];
}
;
;
;
message output " the value is array[0][1]"
I want to implement this in Visual C++.
using MessageBox command wont work unless i enclosed them in "" "" but that would not output the element in the array...Pls help.
Thanks
Use a function like sprintf or snprintf to create the string you want to display, and then input that string to the MessageBox function. The sprintf function gives you the ability to embed an integer inside a string, by using the %d format specifier. It is similar to printf, the difference is printf outputs the string to standard output, while sprintf outputs it to a character buffer.
バルサミコ酢やっぱいらへんで
![]() |
Similar Threads
- assing table values to an array (JSP)
- displaying two dimensional array in columns help (C++)
- Assigning Array Values En Masse (Java)
- integer values into array (Community Introductions)
- passing values from array to array (C)
- Homework: filling array from text file (VB.NET)
- How to assign my own numeric values to a char array? (C++)
Other Threads in the C++ Forum
- Previous Thread: converting from float 2 integer
- Next Thread: container classes and integrators-urgent
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






