Dear All,
Code:
#include<stdio.h>
#define MAX_STR1_LEN 15
#define MAX_STR2_LEN 16
void main()
{
char a,b,c,d,e,f,g,h,j,k,l,m,n,o,count;
char i=4;
char str2[MAX_STR2_LEN]="0123456789abcdef";
chat str1[MAX_STR1_LEN]="0123456789abcde";
str2[MAX_STR2_LEN]=0;
str1[MAX_STR1_LEN]=0;
printf("1.str1:%s str2:%s\n",str1,str2);
strcpy(str1,str2);
printf("2.str1:%s str2:%s\n",str1,str2);
for(count=0;count<i;count++);
str2[MAX_STR2_LEN]='a';
str1[MAX_STR1_LEN]=0;
strcpy(str1,str2);
printf("3. str1:%s str2:%s\n", str1,str2);
for(; count<i;count++);
printf("4. count:%d\n",count);
return;
}
Stack map for above code is as the below from the high address to the low address:
High:a b c d e f g h j k l m n o c i
str2: 0 1 2 3 4 5 6 7 8 9 a b c d e f
str1: 0 1 2 3 4 5 6 7 8 9 a b c d e x
low: x x x x x x x..........
my doubt is "How high address will get a b c d e f g h j k l m n.........weather these values are declared values or what"