diff options
author | CY Lim <cylim@CYs-Macbook-2015.local> | 2015-11-02 11:18:19 +1100 |
---|---|---|
committer | CY Lim <cylim@CYs-Macbook-2015.local> | 2015-11-02 11:18:19 +1100 |
commit | 094761f6936e9fbe625a9175a6404e2dca7d6504 (patch) | |
tree | 0999371c1f48011acdfabe8eb3b0e01760833e06 /c.html.markdown | |
parent | 44ca091c73afe13ec8760021cfed1d77afc5e4a5 (diff) | |
parent | 463cec82d08a58c6452b5b2beec5ee3b99e33ba6 (diff) |
Merge remote-tracking branch 'adambard/master'
Diffstat (limited to 'c.html.markdown')
-rw-r--r-- | c.html.markdown | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/c.html.markdown b/c.html.markdown index 3d632eab..7c2386ef 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -148,15 +148,10 @@ int main (int argc, char** argv) printf("Enter the array size: "); // ask the user for an array size int size; fscanf(stdin, "%d", &size); - char buf[size]; - fgets(buf, sizeof buf, stdin); - - // strtoul parses a string to an unsigned integer - size_t size2 = strtoul(buf, NULL, 10); - int var_length_array[size2]; // declare the VLA + int var_length_array[size]; // declare the VLA printf("sizeof array = %zu\n", sizeof var_length_array); - // A possible outcome of this program may be: + // Example: // > Enter the array size: 10 // > sizeof array = 40 |