mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Add multi-dimensional array description.
This commit is contained in:
parent
5c7f6d70b9
commit
67a5236629
@ -148,6 +148,14 @@ int main() {
|
|||||||
int cha = 'a'; // fine
|
int cha = 'a'; // fine
|
||||||
char chb = 'a'; // fine too (implicit conversion from int to char)
|
char chb = 'a'; // fine too (implicit conversion from int to char)
|
||||||
|
|
||||||
|
//Multi-dimensional arrays:
|
||||||
|
int multi_array[2][5] = {
|
||||||
|
{1, 2, 3, 4, 5},
|
||||||
|
{6, 7, 8, 9, 0}
|
||||||
|
}
|
||||||
|
//access elements:
|
||||||
|
int array_int = multi_array[0][2]; //=> 3
|
||||||
|
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
// Operators
|
// Operators
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user