| | |
C Arrays
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 1,741
Reputation:
Solved Threads: 281
Sometimes when English isn't your native language it is even more difficult to explain what you want to do than it is for us native English speakers. To use multidiminsional arrays you can do something like this:
int array[2][2];
which declares a variable on the stack with enough memory for 4 ints. Now to get the information into that array you can do several things. Here's one way:
int array[2][2];
which declares a variable on the stack with enough memory for 4 ints. Now to get the information into that array you can do several things. Here's one way:
C++ Syntax (Toggle Plain Text)
for(int i = 0; i < 2; ++i) { for(int j = 0; j < 2; ++i) { cout <<"enter a value" << endl; cin >> array[i][j]; } } and to dispay the values you use another nested loop except the body would be something like: //pseudocode to display array as a table for() for() cout << array[i][j] << ' '; cout << endl;
![]() |
Similar Threads
- (reformatted) How to return Multi-Dimensional Arrays (C++)
- What relation does **indirection operator have with Multidimensional Arrays (C++)
- Arrays (C++)
- How to Return Multidimensional Arrays (C++)
- C file input/output 2D arrays. (C)
- passing arrays in visual basic (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: Help with atoi
- Next Thread: Visual Studio Problem
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library lines linker list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






