Array bound checking problem in C language

If programmer accidentally writes loop iterations more than memory size of an array then array will not check its boundary or limit and Therefore loop iterations can able to overwrite and access outside values stored in memory. It is a critical problem known as array bound checking problem. Other high level languages like c++,Java etc  throws an exception for array bound checking problem. 
เคฏเคฆि เคช्เคฐोเค—्เคฐाเคฎเคฐ เค—เคฒเคคी เคธे เคฒूเคช เค•ा เคฆोเคนเคฐाเคต, เค…เคฐे เค•े เคฎेเคฎोเคฐी เคธाเค‡เฅ› เคธे เค…เคงिเค• เคฐเค– เคฆेเคคा เคนै เคคเคฌ เค…เคฐे เคฆ्เคตाเคฐा เค…เคชเคจी เคฌाเค‰ंเคก्เคฐी/ เคธीเคฎा เค•ो เคœाँเคšा เคจเคนीं เคœाเคคा เคนै เคเคตं เคฒूเคช เค…เคฐे เค•ी เคธीเคฎा เค•े เคฌाเคนเคฐ เค‰เคชเคธ्เคฅिเคค เคตैเคฒ्เคฏू เค•ो เคญी เคชเคฐिเคตเคฐ्เคคिเคค เคฏा เคเค•्เคธेเคธ เค•เคฐ เคธเค•เคคा เคนै เค‡เคธ เคธเคฎเคธ्เคฏा เค•ो เค…เคฐे เคฌाเค‰ंเคก เคšेเค•िंเค— เคช्เคฐॉเคฌ्เคฒเคฎ เค•เคนा เคœाเคคा เคนै เคฏเคน เคเค• เค—ंเคญीเคฐ เคธเคฎเคธ्เคฏा เคนै เคœिเคธे C++ เคเคตं JAVA เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฒैंเค—्เคตेเคœ เคฎें เคเค•्เคธेเคช्เคถเคจ เค•ी เคธเคนाเคฏเคคा เคธे เคฆूเคฐ เค•िเคฏा เค—เคฏा เคนै।     

Example :- 
'C' program for array bound checking problem.
void main(){
int list[5],i;
printf("enter values of list array\n");
for(i=0;i<500;i++)
scanf("%d",&list[i]);
printf ( "values of list array\n");
for (i=0;i<500;i++)
printf( "list [%d]=%d\n",i,list[i]);
}

Hence, it is responsibility of programmer to execute loop iteration up to the maximum size of given array.
เค…เคค: เคฏเคน เคช्เคฐोเค—्เคฐाเคฎเคฐ เค•ी เคœिเคฎ्เคฎेเคฆाเคฐी เคนोเคคी เคนै เค•ि เคตो เคฒूเคช เค•ो เคฒिเค–เคจे เคธे เคชूเคฐ्เคต เค…เคฐे เค•ी เคธीเคฎाเค เคœाँเคš เคฒे 

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students