| | |
C Arrays
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 1,688
Reputation:
Solved Threads: 265
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 |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






