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

7 lines
338 B
Plaintext
Raw Normal View History

2017-07-18 04:35:42 +00:00
// 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.