Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 21 Jan 2015 06:27 PM |
when I try to create a matrix like this:
int matrix[][] = {{1,2},{3,4}};
I get an error saying "an array may not have elements of this type". However, when I do this:
int matrix[][2] = {{1,2},{3,4}};
It works fine. My question is why do I have to specify the size of the second dimension? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jan 2015 06:30 PM |
| A multidemensional array must have declared sizes for all but the first. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jan 2015 06:31 PM |
| I'm more of a C guy but why not use a vector (part of std namespace)? |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jan 2015 07:00 PM |
| Have you seen yourself Mr. horrible at dota |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:07 PM |
| Oh god. Who woke the troll up this time.. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:25 PM |
| I actually thought both dimensions needed to be set, maybe that book was too old after all. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 21 Jan 2015 07:27 PM |
| It's honestly better if they are both/all set. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:32 PM |
| Can't killme you more of an B guy cuz u BASIC you lame skid. |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jan 2015 07:34 PM |
| Isaac ew u r new here u punk leave!!!!!!1 |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jan 2015 07:36 PM |
Yay, the c++ noob was right!!1111 Maybe I will learn it. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:40 PM |
| @ChiefDelta - i am learning lua though and so far so good |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:41 PM |
| Isaac it will take a bit but good on u |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:52 PM |
>C++ >Scripters
gtfo this is lua |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 07:53 PM |
that conex guy is here.
::_::goto_ |
|
|
| Report Abuse |
|
|