Code:
unsigned char special[8][8] = { { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' },
{ 'I', 'J' ,'K' ,'L', 'M', 'N', 'O', 'P' },
{ 'Q', 'R' ,'S' ,'T', 'U' ,'V', 'W', 'X' },
{ 'Y', 'Z' ,'a' ,'b', 'c' ,'d', 'e', 'f' },
{ 'g', 'h' ,'i' ,'j', 'k' ,'l', 'm', 'o' },
{ 'p', 'q' ,'r' ,'s', 't' ,'u', 'v', 'w' },
{ 'x', 'y' ,'z' ,'1', '2' ,'3', '4', '5' },
{ '6', '7' ,'8' ,'9', '0' ,'*', '+', '-' }
};
// define a pointer for Array
unsigned char* special_ref;
void specialcarachter (unsigned char* character)
{
unsigned char memoryplace[8] = { '0','1','2','3','4', '5', '6', '7' };
int i = 0, j=0;
for (j=0; j<=7;j++)
{
printf ("This is the place: %c \n", memoryplace[j]);
for (i=0; i<=7;i++)
{
// why does this is a correct ???
printf ("This is a test === %c \n", character[j*8+i]);
// ok, i walk through the memory with eight steps, because one of these character J, are eight characters long:
// character[0*8+0] == 'A'
// character[1*8+1] == 'B'
// character[2*8+2] == 'C'
// why does this is incorrect, it is easier, but wrong???
//printf ("This is a test === %c \n", character[j][i]);
}
}
}
int main (void)
{
special_ref = special;
specialcarachter(special_ref);
return 1;
}
Meine 1. Frage, warum wird eine Warnung für diesen Pointer ausgegeben?
Lesezeichen