2014-09-24 14:45:10 +00:00
|
|
|
|
/*
|
|
|
|
|
!!DESCRIPTION!!
|
|
|
|
|
!!ORIGIN!! testsuite
|
|
|
|
|
!!LICENCE!! Public Domain
|
|
|
|
|
!!AUTHOR!!
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
typedef signed int TypA[3];
|
|
|
|
|
typedef struct TypB {
|
2019-02-12 21:50:49 +00:00
|
|
|
|
TypA Data[2];
|
2014-09-24 14:45:10 +00:00
|
|
|
|
} sTypB;
|
|
|
|
|
sTypB Bs[10];
|
|
|
|
|
TypA * APtr;
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
2019-02-12 21:50:49 +00:00
|
|
|
|
Bs[7].Data[1][2]=11;
|
|
|
|
|
APtr=&(Bs[7].Data[1]);
|
|
|
|
|
printf("Hallo Welt! %i = %i \n",Bs[7].Data[1][2], (*APtr)[2] );
|
|
|
|
|
return 0;
|
2014-09-24 14:45:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
....gives
|
|
|
|
|
test.c(20): Error: Incompatible pointer types
|
|
|
|
|
for <EFBFBD> APtr=&(Bs[7].Data[1]);
|
|
|
|
|
|
2022-04-17 14:07:52 +00:00
|
|
|
|
My experience in C is very limited, but as this works both in MSVC and
|
2014-09-24 14:45:10 +00:00
|
|
|
|
the 8 bit Z80 compiler i originally used, i guess its an bug in CC65.
|
|
|
|
|
|
|
|
|
|
As a workaround, an typecast via <EFBFBD>APtr=(TypA*)&(Bs[7].Data[1]);
|
|
|
|
|
seems to work.
|
|
|
|
|
|
|
|
|
|
greetings,
|
|
|
|
|
<EFBFBD> <EFBFBD>Andreas
|
2022-04-16 17:51:48 +00:00
|
|
|
|
*/
|