What does it mean when the array name is in parentheses with a carriage pointer in front of it?

I have an array of unsigned numbers called dataArray (in fact, in the program I am trying to figure out, they are entered as hexadecimal numbers, but I do not think this is important). I have another variable of type unsigned char called c.

What does it do?

unsigned int dataArray[]={1,2,3,4,5};
unsigned char c;
x=c^ (dataArray)[i];

I read that the carriage is a reference to c, but what does it mean when the array name is in parentheses? It seems that x is just set to the (i-1) th element in the dataArray, but under what conditions is it not?

Thanks.

+3
source share
6 answers

Brackets do not affect semantics here. x is evaluated as a bitwise exception - or c (undefined here) and dataArray [i].

+11

. ++/CLI, microsoft .Net. ++. , , - XOR.

+2

^, , XOR (. wikipedia). , [] , -xor.

+1

++, "^" XOR. .

0

I am not overloaded as far as I know. If it is entered and compiled correctly, it will try to perform the XOR operation, although in this case it will probably mess with data that you don't want ...

0
source

Nice cool. This makes sense in the program I use. I thought the carriage was a pointer, but this is XOR, and then in the line there is a and (bitwise AND). The program is designed to send and receive signals from electronics, so you should expect bit-level logic. Thanks so much for the quick answers.

0
source

Source: https://habr.com/ru/post/1702589/


All Articles