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
Post a Comment