summaryrefslogtreecommitdiffhomepage
path: root/c.html.markdown
diff options
context:
space:
mode:
authorJacob Ward <jacobward1898@gmail.com>2015-10-30 07:39:58 -0600
committerJacob Ward <jacobward1898@gmail.com>2015-10-30 07:39:58 -0600
commitbb006a51c12e59ba215a7eab340bbbac8d024278 (patch)
tree1920b3770541783fb9e83e9ee41017c6f060cf33 /c.html.markdown
parent011c0b5fc7c723011f79554720593873f5275cca (diff)
parentf0a4c88acfac9514aca6dd33e2d3f8c4d5e815dc (diff)
Merge remote-tracking branch 'adambard/master'
Diffstat (limited to 'c.html.markdown')
-rw-r--r--c.html.markdown9
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