Hello
I have class where i declared an array and i want to use the value of same array in other class.
I don't want to create any object to access the array .so i tried declare the array as extern.
code as below
class emu
{
UCHAR D0[8];
void decimarconverter(UCHAR *answer)
{
for(int i =0;i<=7;i++)
{
D0[i] =answer[0]%2;
answer[0] = answer[0]/2;
qDebug()<<"Binary number is D0"<<D0[i];
}
}
class emu1
{
extern UCHAR D0[]
void show()
{
for(int i =0;i<=7;i++)
qDebug()<<D0[i]<<"Value";
}
}
class emu
{
UCHAR D0[8];
void decimarconverter(UCHAR *answer)
{
for(int i =0;i<=7;i++)
{
D0[i] =answer[0]%2;
answer[0] = answer[0]/2;
qDebug()<<"Binary number is D0"<<D0[i];
}
}
class emu1
{
extern UCHAR D0[]
void show()
{
for(int i =0;i<=7;i++)
qDebug()<<D0[i]<<"Value";
}
}
To copy to clipboard, switch view to plain text mode
But i am getting an error
error: 'UCHAR' does not name a type
extern UCHAR D0[];
Can any one let me know why i am getting the error
Bookmarks