Arrays :: General


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #include <iostream>
  2. #include <array>
  3. #define ARRAY_SIZE(array) ((sizeof(0) / sizeof(array[0])))
  4. using namespace std;
  5. int main(int argc, char *argv[]) {
  6.  
  7. long int nums[13] = {1,9,900000,0,2,3,4,9000000000000,5,6,7,8,00};
  8. cout << ARRAY_SIZE(nums);
  9. }
  10.  
  11. #will get the length of the array

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.