Raised This Month: $ Target: $400
 0% 

Help with multi-dimensional arrays


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Blackhawk
Member
Join Date: Apr 2005
Old 08-24-2005 , 18:33  
Reply With Quote #5

Quote:
Originally Posted by Freecode
Quote:
Originally Posted by Blackhawk
Now, if i use something like
Code:
Testarray[3] = {0,0,0,0,0}
on it, i wipe out the entire row. the Result would be like this:
Code:
        0     1     2     3     4     
0      33   22   54    24   54
1      11   22   52    54   99
2      35   12   45    86   53
3      0     0     0      0     0
4      43   36   44    67   44
Testarray[3] will look like this
Code:
       0     1     2     [3]
      #     #    #      \0
and to zero that out it will be like this
Testarray[3] = {0,0,0};
but Testarray[3] = {0,...}; should work. did u try it?
This works, but i need the same on multidimensional arrys (as the topic says )

Defined was Testarray[5][5], so Testarray[3] selects 5 unique values, not just one. My 'problem' is: I wanted to know a smart way to 'nullify' a whole line in a multidimensional array, no matter how big the array might be, ie 32 Lines of 50 values.Testarray[3] = {0,...} works perfectly on single dimensional arrays.
__________________
Outpost 104 - last hope for teamplay
Blackhawk is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode