Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 can anyone help me with two dimensional arrays?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
sevendust




PostPosted: Tue Nov 30, 2004 2:08 pm   Post subject: can anyone help me with two dimensional arrays?

heres the question i cant figur out...
write a program that creates a 4x4 array called BINARY containing integers. load the array with a 1 when the row and colummn are the same and a 0 when the row and column are different.i.e binary(1, 1)=1, binary (2,2)=1, etc, all other elements are 0....thanks to the person who can email me the answer at richardo1988@hotmail.com or post it here, thanks very much
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Tue Nov 30, 2004 2:38 pm   Post subject: (No subject)

Search the forums, there are a million array tutorials.

http://www.compsci.ca/v2/search.php
Cervantes




PostPosted: Tue Nov 30, 2004 6:02 pm   Post subject: (No subject)

Arrays and for loops are built to work together. Use those for loops. You've got a 2-demensional array, so use 2 for loops. If the counters of the for loops are the same, make the array = 1, otherwise, make the array = 0.
Mr. Glib




PostPosted: Tue Nov 30, 2004 9:51 pm   Post subject: (No subject)

sevendust, don't forget to use a check to see if the row and col numbers are equal to one another.
Andy




PostPosted: Wed Dec 01, 2004 4:01 pm   Post subject: (No subject)

err wtf u talkin about.. wth does the row and col have to equal each other
SuperGenius




PostPosted: Wed Dec 01, 2004 5:43 pm   Post subject: (No subject)

I think it's just a peculiar assignment.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: