diff options
author | Dennis Keller <dk.denniskeller@gmail.com> | 2015-10-31 11:11:06 +0100 |
---|---|---|
committer | Dennis Keller <dk.denniskeller@gmail.com> | 2015-10-31 11:11:06 +0100 |
commit | ca6ea580c7df41730fe547b0c35b3406dc9e590f (patch) | |
tree | 8f6daf20606ce1dd0e050c8b65ebcef452e20d0e /c.html.markdown | |
parent | 2c99b0a9553f25a7ac43b04a14c4e2d78fe2b318 (diff) | |
parent | edfc99e198fd2e87802ea81d6779fbadfab64919 (diff) |
Merge remote-tracking branch 'upstream/master' into scala/de
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 |