Home > Back-end >  The c language
The c language

Time:06-03

# define LEN ((int) (sizeof (country_codes)/sizeof (country_codes [0]))) please bosses to explain

CodePudding user response:

Int LEN=(sizeof (country_codes)/sizeof (country_codes [0]));

CodePudding user response:

Look at the macro definition to know

CodePudding user response:

The size of the array, the array size

CodePudding user response:

This definition is to determine the number of elements in the array of
Devide the code before array is to calculate the overall occupy memory size
Devide is followed by the size of the array elements each occupy the content

CodePudding user response:

Sizeof (country_codes) : the entire array size
Sizeof (country_codes [0])) : the size of the array element
Macro definition: textual substitution

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related