2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-19 03:25:44 +00:00
cheat.sheets/sheets/_cpp/arrays
2018-05-19 20:40:04 +00:00

7 lines
338 B
Plaintext

// In C++11 you can do the following, but most people use vector instead of arrays
a.size(); // Returns the size of array a
int a[10]; // Declare an int array with length 10.
a[0] = 420; // Set the value 420 to index 0 of array a
int b = a[0] // Set variable b to 420 by accessing index 0 of array a.