mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
issue 2205: Change variable 'size' to 'array_size'
This commit is contained in:
parent
d6b665f91c
commit
7b78232897
@ -143,9 +143,9 @@ int main (int argc, char** argv)
|
|||||||
// can be declared as well. The size of such an array need not be a compile
|
// can be declared as well. The size of such an array need not be a compile
|
||||||
// time constant:
|
// time constant:
|
||||||
printf("Enter the array size: "); // ask the user for an array size
|
printf("Enter the array size: "); // ask the user for an array size
|
||||||
int size;
|
int array_size;
|
||||||
fscanf(stdin, "%d", &size);
|
fscanf(stdin, "%d", &array_size);
|
||||||
int var_length_array[size]; // declare the VLA
|
int var_length_array[array_size]; // declare the VLA
|
||||||
printf("sizeof array = %zu\n", sizeof var_length_array);
|
printf("sizeof array = %zu\n", sizeof var_length_array);
|
||||||
|
|
||||||
// Example:
|
// Example:
|
||||||
|
Loading…
Reference in New Issue
Block a user