Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can you find the bug of this code

Status
Not open for further replies.

AliBahar

Member level 2
Member level 2
Joined
Feb 4, 2015
Messages
42
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
337
Hi friends,
I have written the below code which is compiled with codevisionAVR:
Code:
typedef struct {
    unsigned char QAddrHi;
	unsigned char QAddrLo;
	unsigned char QcountHi;
	unsigned char QcountLo;
	unsigned char RByteCount;
	unsigned int RNum;
	unsigned char RData[NumDefault];
} IOData;
IOData.QAddressHi=*data;

data is the name of an array and it's type is unsigned char;
but this error appears:illegal symbol.
 

What about that:

Code:
typedef struct {
    unsigned char QAddrHi;
	unsigned char QAddrLo;
	unsigned char QcountHi;
	unsigned char QcountLo;
	unsigned char RByteCount;
	unsigned int RNum;
	unsigned char RData[NumDefault];
} IOData;
IOData MyData;

int main() {
   MyData.QAddressHi = *data;
}

EDIT: Of course it does not work, because QAddressHi does not exists in your structure.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top