Anubhav Hanjura wrote:
>
>
#include<stdio.h>
main()
{
int i[4] ;
int j = 0;
i[j++] = j++;
/* you put the previous lin in a loop j will be increment by 2 every
time
the line is executed.
The result will be i[0] = 0
i[1] = unknown
i[2] = 2
i[3] = unknown
i[4] = 4
etc etc .....
To prevent this replace by i[j++] = j;
*/
printf("%d %d %d %d\n",i[0],i[1],i[2],i[3]);
return 0;
}
- Arrays is confusing Anubhav Hanjura
- Re: Arrays is confusing Joseph Keen
- Re: Arrays is confusing Henk Jan Barendregt
- Re: Arrays is confusing Vitaly Fedrushkov
- Re: Arrays is confusing Erik Sohns
- Re: Arrays is confusing Henk Jan Barendregt
