Issue with C syntax
Ray0665
Posts: 231
Im getting a syntax warning I dont understand
can anyone help ?
I made the follow in declarations in C
#define stx 0x02
unsigned int GetByte() {int x; read (usbPort, &x, sizeof(x) ); return x; }
and I am getting the following warnings which I do not understand
warning: comparison between pointer and integer [enabled by default]
do while (GetByte != stx) {}
^
error: expected while before N
N = GetByte;
And later in the program I get this:
warning: assignment makes integer from pointer without a cast [enabled by default]
Ck2 = GetByte;
where Ck2 is declared as
unsigned short int N, Ck1, Ck2;
can anyone help ?
I made the follow in declarations in C
#define stx 0x02
unsigned int GetByte() {int x; read (usbPort, &x, sizeof(x) ); return x; }
and I am getting the following warnings which I do not understand
warning: comparison between pointer and integer [enabled by default]
do while (GetByte != stx) {}
^
error: expected while before N
N = GetByte;
And later in the program I get this:
warning: assignment makes integer from pointer without a cast [enabled by default]
Ck2 = GetByte;
where Ck2 is declared as
unsigned short int N, Ck1, Ck2;
Comments
You have cleared all the issues now I just have to remember it..