5, brothers to write the detailed point
CodePudding user response:
Didn't say is what type, the number of signed here also didn't say how much a single-chip microcomputer, if it is of type int, 32-bit words: (4 bytes)
4//# define SYSTEM_BYTE type is 4 bytes
Typedef int SYSTEM_TYPE
1////# define SYSTEM_BYTE type is 1 byte
//typedef char SYSTEM_TYPE
The static struct
{
Int positive_number;
Int negative_number;
Int zero;
} analysis;
Void statistics (int addr)
{
SYSTEM_TYPE I;
For (I=0 x2000; I & lt; (0 x2000 + 100 * SYSTEM_BYTE); I +=SYSTEM_BYTE)
{
If (* I & gt; 0)
{
Analysis. Positive_number + +;
}
Else if (* I==0)
{
Analysis. Zero++;
}
The else
{
Analysis. Negative_number + +;
}
}
}
CodePudding user response: