From 09ee4821ee1daa92c14d7b3fbeb4eab15f2860ba Mon Sep 17 00:00:00 2001 From: Prashanth Thiagarajan <43838361+b-man157@users.noreply.github.com> Date: Sat, 20 Oct 2018 01:55:11 +0530 Subject: [PATCH] Update index.md (#21488) --- guide/english/c/dynamic-memory-management/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guide/english/c/dynamic-memory-management/index.md b/guide/english/c/dynamic-memory-management/index.md index 3ddc1a8031..acd7459d6a 100644 --- a/guide/english/c/dynamic-memory-management/index.md +++ b/guide/english/c/dynamic-memory-management/index.md @@ -2,7 +2,7 @@ title: Dynamic Memory Management --- # Dynamic Memory Management -Sometimes you will need to allocate memory spaces in the heap also known as the dynamic memory. This is particulary usefull when you do not know during compile time how large a data structure (like an array) will be. +Sometimes you will need to allocate memory spaces in the heap also known as the dynamic memory. This is particulary useful when you do not know during compile time how large a data structure (like an array) will be. ## An Example Here's a simple example where we allocate an array asking the user to choose the dimension ```C @@ -13,7 +13,8 @@ int main(void) { int arrayDimension,i; int* arrayPointer; - scanf("Please insert the array dimension:%d",arrayDimension); + printf("Please insert the array dimension:"); + scanf("%d",&arrayDimension); arrayPointer = (int*)malloc(sizeof(int)*arrayDimension); if(arrayPointer == NULL){