RSS Forums RSS
Please support our C++ advertiser: Programming Forums
Views: 13070 | Replies: 13
Reply
Join Date: Sep 2004
Posts: 6,585
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 501
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Need help passing a multi-dimensional array

  #11  
Jul 23rd, 2005
>Any ideas?
Yes, you could stick your head in a bucket of jello twice a day and run around the office naked screaming the national anthem at the top of your lungs.

>void draw(char[], int, int);
...An array of char isn't the same as a two dimensional array of char either. How about changing it to:
void draw ( char (*)[3], int, int);
As the error suggests you should do?
I'm here to prove you wrong.
Reply With Quote  
Join Date: Feb 2005
Posts: 464
Reputation: winbatch is on a distinguished road 
Rep Power: 4
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: Need help passing a multi-dimensional array

  #12  
Jul 23rd, 2005
You could also change it to char ** (much like it is often defined as a command line parameter here...)

int main( int argc, char ** argv )
Reply With Quote  
Join Date: Jul 2005
Location: Okc, OK
Posts: 25
Reputation: sifuedition is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
sifuedition's Avatar
sifuedition sifuedition is offline Offline
Light Poster

Solution Re: Need help passing a multi-dimensional array

  #13  
Jul 23rd, 2005
I have worked out all of the bugs now. Thank you everyone for the advice (despite some unnecessary grief). I could not find the information anywhere so your help was invaluable. I think I will work on some error checking in the input values and call it done. Thanks again.
Reply With Quote  
Join Date: Sep 2004
Posts: 6,585
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 501
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Need help passing a multi-dimensional array

  #14  
Jul 23rd, 2005
>You could also change it to char **
No, you couldn't because the argument is a two dimensional array. The "arrays are converted to pointers" rule only applies to the first dimension, so a[M][N] is equivalent to (*a)[N], but not equivalent to **a.

>much like it is often defined as a command line parameter here...
No, not really. argv and what the OP is trying to do are two completely different things.
I'm here to prove you wrong.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:30 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC