I'm trying to code in C with the bit operator 'or' (¦
) (quite simple, I know).
However, when I compile it in GCC, I get:
error: stray \302 and stray \246
I tried to look for a solution to this problem, and all that I saw was that this error happens when the compiler doesn't recognize the symbol. What can I do to make it work?
My code is:
#include "stdio.h"
int main(int argc, char const *argv[]) {
int x, y , z;
x = 0xffff;
y = 0x8888;
z = x ¦ y;
printf("0x%u \n", z);
return 0;
}
Here is the error on the terminal:
ex_8_4.c: In function ‘main’:
ex_8_4.c:19:3: error: stray ‘\302’ in program
z = x ¦ y;
^
ex_8_4.c:19:3: error: stray ‘\246’ in program
ex_8_4.c:19:12: error: expected ‘;’ before ‘y’
z = x ¦ y;
^
Apparently I used the wrong symbol (¦ instead of |) (for some reason that's how it's appear in the book), so now it's working.