Anonymous user
AGS Pointers for Dummies: Difference between revisions
Jump to navigation
Jump to search
m
→Array of Pointers
*>Monkey 05 06 |
*>Monkey 05 06 |
||
Line 44: | Line 44: | ||
With arrays you can't assign initial values, and the valid indices are from 0 to the size of the array minus one (in this case, 0 to 4). You treat an array of pointers just like you would ordinary pointers. | With arrays you can't assign initial values, and the valid indices are from 0 to the size of the array minus one (in this case, 0 to 4). You treat an array of pointers just like you would ordinary pointers. | ||
===Dynamic Array of Pointers=== | |||
As of AGS 3.0, you can have {{link|Dynamic Arrays||dynamic arrays}} of the built-in types, including the managed types. The assignment here works a little differently: | |||
GUI *daguis[] = new GUI[5]; | |||
Notice that we don't use an asterisk after the '''new''' keyword. Keep that in mind if you plan to use dynamic arrays of pointer types. | |||
=Assigning A Pointer A Value= | =Assigning A Pointer A Value= |