We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
#include <reg51.h> void main() { int a[3][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11}}; int (*p)[4]; int b=0; /b=256 why??? int c; p=a; b=*(*p+2)+3; b++; c=b; } #include <reg52.h> void main(void) { unsigned int wer[5]={0,1,2,3,4}; unsigned int b=0; //result:b=256 why???? unsigned cde; b+=1; //b=257 why???????? b--; //b=256 why???? b++; }
b!=0 why??? -------------------------------------------------------------------------------- #include <reg51.h> void main() { int a[3][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11}}; int (*p)[4]; int b=0; // b=0 int c; p=a; b=*(*p+2)+3; b++; c=b; } #include <reg52.h> void main(void) { unsigned int wer[5]={0,1,2,3,4}; unsigned int b=0; //result:b=0 unsigned cde; b+=1; //b=1 b--; //b=0 b++; } On mine, it works... regards Dejan