Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desperate help needed!! URGENT!

Status
Not open for further replies.

Butterflies

Programmer
Mar 23, 2005
4
0
0
US
Note that we are just BEGINNER C programmers...and we need help! Any help is very much appreciated...thank you so much!

We were trying to figure out how to input variables into 2D arrays. For example if there are 2 variables named "a" and "b" and they represent the numbers "1" and "2" respectively, can we have something like "int array[a]" so that there are 1 row and 2 columns? We are really stuck on that part. Thanks!
 
Make an array like:

int array[ 20 ][ 40 ];

to make a 20x40 array. Just refer to the elements like:

array[ 5 ][ 26 ] = 7;

etc.

(Remember, it's [x][y], not [x,y])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top